|
Posted by J.O. Aho on 12/10/06 13:08
ulyx wrote:
> How to block multiple checkbox selections
> http://www.smartwebby.com/PHP/Phptips2.asp
Use radiobuttons instead or you need to throw in javascript (don't use jscript
as it works on limited browsers) that checks if more than one checkbox is
marked, but how to do that, you should ask on a javascript newsgroup.
> how to pull out checkbox values ( written in db on this way: 1,2,3 (where
> the delimiter is the - , - sign) ?
$array=explode(',',$row[X]);
<input type="checkbox" name="something" <?php if(in_array("something",$array))
{ echo "CHECKED"; } ?>>
Don't say that the example will work right off, it's a long time since I used
checkboxes, but just make minor tweaks and it should work fine.
//Aho
[Back to original message]
|