Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBoxes with same name 1

Status
Not open for further replies.

dellyjm

Programmer
Apr 13, 2000
168
JM
How do you handle checkboxes with the same name.

For example.

1. Delton Phillips Swimmer (Checkbox here)
2. DASton Phillips Swimmer (Checkbox here)
3. DSAFlton Phillips Swimmer (Checkbox here)
4. Pelton Phillips Swimmer (Checkbox here)
5. Telton Phillips Swimmer (Checkbox here)

How do I know which one was clicked when it's submitted thru a form. A value will be passed only when the user checks the box. How do I solve that?

Delton.
 
Hi,

A checkbox has a name and a value! When you check several checkboxes you will have a name with an "array" of values. With this values you know what were the choices checked!!

Regards,
Luís Silva
 
Yes, I know but the choices that aren't checked have no value. Lemme give you an example.

1. Delton Phillips Swimmer (Checkbox here)
2. DASton Phillips Swimmer (Checkbox here)
3. DSAFlton Phillips Swimmer (Checkbox here)
4. Pelton Phillips Swimmer (Checkbox here)
5. Telton Phillips Swimmer (Checkbox here)

If all those were checked then it'd return whatever I put right? what if number 3 and number 5 weren't checked. How would I know which one was?

Delton.
 
Hi again,

Suppose the checkbox name is "chkbox" and:
Delton Phillips Swimmer has value 1,
DASton Phillips Swimmer has value 2,
DSAFlton Phillips Swimmer has value 3,
Pelton Phillips Swimmer has value 4,
Telton Phillips Swimmer has value 5.
If all were checked you'll have chkbox = {1, 2, 3, 4, 5}.
If you only have:
Delton Phillips Swimmer,
DASton Phillips Swimmer,
Pelton Phillips Swimmer
checked you'll have chkbox = {1, 2, 4}. When you made the form you know that 1 stands for Delton Phillips Swimmer, etc, etc!

Regards,
Luís Silva
 
Can't you assign the Name of the Swimmer as the value of the check box?? QUOTE OF THE DAY
"The most important ingredient in the formula of success is knowing how to get along with people"
<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top