Page 1 of 1
Questions on check boxes in php
Posted: Mon May 25, 2009 1:01 pm
by DanielWayne
I can make dropdown menus, comment areas but i cannot figure out how to make checkboxes or at least turn any drop down list i make into multiple choice checkboxes.
This is for a dating site i have and check boxes just seem to be more appealing i guess.
In the dating program i have, 3 different pages have to come together to make everything work...sighs

. i dunno, i am stuck. Can anyone give me any advice. One more thing, i dont know much about coding at all. Just what i have learned through trial and error screwing with my site picking up on things and following what was done prior.
Thanks,
Daniel
Re: Questions on check boxes in php
Posted: Mon May 25, 2009 2:28 pm
by Darhazer
When checkbox is checked, it is send with the request, otherwise is not.
In other words, unlike the select, text, etc. inputs, you should not check for the exact value in the submitted data, but for the value presence at all.
Re: Questions on check boxes in php
Posted: Mon May 25, 2009 2:56 pm
by DanielWayne
Ok not even sure what ya just said but to make life a little more simple let me just show the code for it.
Here is what i see for a simple dropdown...
td align="left" nowrap width="11%"><span class=mandatory>*</span>
<?php echo ADVERTISE_HAIR?>
</td>
<td width="25%" >
<select class="input" name="lstHaircolor" size="1" tabindex="24">
<option selected>-
<?php echo GENERAL_CHOOSE?>
-</option>
<?php populate_lists('HAR','base','adv',$_SESSION['post']['lstHaircolor']); ?>
</select>
</td>
Then to print in on the page where the selection is viewed by others the code is...
<tr>
<td nowrap ><span class="rettext"><?php echo OPTION_HAIR_COLOR?>:</span>
<?php print(transl_value($sql_array->adv_haircolor,"EYE")); ?></td>
</tr>
But i dont want them all as drop down options. I need some in checkbox options and just need to know if anyone knows of a simple way to change/switch it over?
Thanks,
Daniel
Re: Questions on check boxes in php
Posted: Mon May 25, 2009 5:00 pm
by DanielWayne
Well, i thought i had it but now it prints the word...
Array