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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Check Boxes in GoLive

Status
Not open for further replies.

ncdesigner

Technical User
Mar 16, 2009
1
0
0
US
I've used check boxes to allow multiple answers to single questions in a form. According to GoLive it should allow more than one answer for the question. The only answer I'm getting is the last box checked regardless of the number selected.

Why? How do I fix it?

see it:

thanks for your help!!!
ncdesigner
 
Your problem is that you have given each section of check boxes the same name. Each check box must have a unique name.

Pies

strawberry
peach
apple
cherry

Say i have a check box for each type of pie, but all the check boxes are named pie. If peach is checked then pie=peach, but if cherry is also checked then pie is set to equal cherry so now pie=cherry. See how the value of pie changed. Separate names for each check box will prevent the values from changing.
 
I just noticed something else. You need to declare each input as a check box with type=checkbox.


<FORM ACTION="ProcessForm.php">

<INPUT TYPE=CHECKBOX NAME="strawberry">strawberry<BR>
<INPUT TYPE=CHECKBOX NAME="peach">peach<BR>
<INPUT TYPE=CHECKBOX NAME="apple">apple<BR>
<INPUT TYPE=CHECKBOX NAME="cherry">cherry<P>

<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top