Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-28-2009, 09:08 PM   PM User | #1
Dhuan
Regular Coder

 
Join Date: Mar 2009
Posts: 120
Thanks: 13
Thanked 3 Times in 3 Posts
Dhuan has a little shameless behaviour in the past
Checkbox problem

Code:
<form>

In my body, there are...<br>
<input type=checkbox name=body value=arms>...arms<br>
<input type=checkbox name=body value=legs>...legs<br>
<input type=checkbox name=body value=hands>...hands<br>
<input type=checkbox name=body value=fingers>...fingers<br>
<input type=submit>

</form><P>


Result: <?=$_GET[body] ?>
Alright, what I want to know is, what's the use of having the checkbox if the value will only be the last checked?
I wonder if I made myself clear enough.
You see, the checkbox is supossed to work so you can have multiple options selected, but that's not what it happens here...
Dhuan is offline   Reply With Quote
Old 03-28-2009, 09:12 PM   PM User | #2
djm0219
Senior Coder

 
djm0219's Avatar
 
Join Date: Aug 2003
Location: Wake Forest, North Carolina
Posts: 1,229
Thanks: 2
Thanked 190 Times in 188 Posts
djm0219 is on a distinguished road
Name them differently or, if you're going to be using PHP, name them as body[] which will make their values available in the body array when you are processing the page with PHP.
__________________
Dave .... HostMonster for all of your hosting needs
djm0219 is offline   Reply With Quote
Old 03-29-2009, 12:46 AM   PM User | #3
RomanTaylor
Regular Coder

 
Join Date: Mar 2009
Location: Troutdale, OR
Posts: 145
Thanks: 12
Thanked 6 Times in 6 Posts
RomanTaylor is an unknown quantity at this point
Code:
<form>

In my body, there are...<br>
<input type=checkbox name=body value=arms>...arms<br>
<input type=checkbox name=body value=legs>...legs<br>
<input type=checkbox name=body value=hands>...hands<br>
<input type=checkbox name=body value=fingers>...fingers<br>
<input type=submit>

</form><P>
It overwrites itself.
RomanTaylor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:46 AM.


Advertisement
Log in to turn off these ads.