April 21st, 2000, 03:46 PM
-
...when a form has a question where the response can be one or more selections either from a series of chech box inputs or a selection list, how would i set into variables only the responses that are checked or selected so that only these values are available for exporting to a mySQL database?
...help with this will be much appreciated.
April 22nd, 2000, 07:07 AM
-
janaka,
you can check whether the variable is set or not with isset()function..
if (isset($checkbox)){
#set the value for the varibale here..
}
------------------
SR -
shiju.dreamcenter.net
April 23rd, 2000, 10:16 PM
-
if you mean you have something like ..
option1<input type=radio name=thisfield value=1>
option2<input type=radio name=thisfield value=2>
then form variable $thisfield = 1 or 2 depending on selection, then in a conformation form you would use....
option1<input type=radio name=thisfield value=1 <?php if($thisfield==1){ echo "checked";}?>>
option2<input type=radio name=thisfield value=2 <?php if($thisfield==2){ echo "checked";}?>>
AM I even close to what you meant?
------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL