Page 1 of 1

a big ??? problem for me

Posted: Sun Jul 14, 2002 4:49 am
by dragosul
I have a large <form> a really large form and i wish to make the php "lighter" if u can understand me :P

this is my problem :

..................................................................
i have many checkboxes like this one here with name and value
u can see then end of the name is the same with the value
and i wish to make a if something like
substr from name only the end part from the _ and check if is == with that value if so regist else not

<INPUT TYPE="CHECKBOX" NAME="region_lazio" VALUE="lazio">


can u understand me ?

i really need help the from is HUGE :< with many checkboxez like this and many values

Posted: Mon Jul 15, 2002 1:57 am
by twigletmac
When using checkboxes it is easiest to put the results into an array so:

Code: Select all

<INPUT TYPE="CHECKBOX" NAME="region&#1111;]" VALUE="lazio" />
For all the checkboxes that were previously name="region_something" put name="region[]", then you can loop through the resulting array to find out what was picked and to do different things accordingly. I'm not clear on what you need to do with the information though so I can't give you a good example of that. If you could explain in a bit more detail I'll try to help a bit more.

Mac