/    Sign up×
Community /Pin to ProfileBookmark

Get value of multiple checkboxes

I have a form where I can have one or multiple checkboxes,, (depending on what is on the D?

What I need is: on the page that the form sends it´s info to,, get the values of the checkboxes that the user selected on the previews page. All checkboxes will have the same name,, but different values… Anyone ever had to do that??

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Doc_ThirstAug 29.2006 — Sure, you can accomplish this with an array. This example grabs all the records then has a checkbox for each one to delete. The second part is a list of records to be deleted

Here is your input:

[CODE]<input type='checkbox' name='delete[]' value='$recordnumber'>[/CODE]

and here is your output

[CODE]foreach($_POST['delete'] as $record)
{
$recordset = mssql_query ("select * from items WHERE (id = '$record')", $handle);
while($arr = mssql_fetch_row($recordset))
{
echo "<tr width=%100>";
echo "<td width='50%'>$arr[2]</td><td width='50%'>$arr[3]</td>";
echo "</tr>";
}
}[/CODE]
Copy linkTweet thisAlerts:
@Marlon_BrauthorAug 29.2006 — That was it!! Thanks a lot!!
×

Success!

Help @Marlon_Br spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...