multiple name/values in one checkbox

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tennis_blues
Forum Newbie
Posts: 21
Joined: Sun Oct 20, 2002 8:30 am

multiple name/values in one checkbox

Post by tennis_blues »

hi,
i am pretty sure i cant do what i want to do, so i am hoping of a good workaround....i hope you can help!

i want to send multiple names and values from a checkbox

so, for example:
<input type=checkbox name1=FirstName[] value1=Sue name2=LastName[] value2=Jones>
<input type=checkbox name1=FirstName[] value1=Tom name2=LastName value=Johnson>

can someone please point me in the right direction

thanks so much in advance!
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

I'm not sure exactly what you're asking but this might help:

If you set value = this_that_other, you can pass three VARs. Explode the this_that_other string to get an array with each of the VARs.
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

no you can't do it because its not part of the (X)HTML specification. a workaround that comes to mind is a multiple select box.
tennis_blues
Forum Newbie
Posts: 21
Joined: Sun Oct 20, 2002 8:30 am

Post by tennis_blues »

thanks both for your help
Post Reply