if yes. how to handle it
disable some option in selectbox
Moderator: General Moderators
disable some option in selectbox
Hi all I have drop down select box the value is select out of db , is that possible to disable some option ?
if yes. how to handle it
if yes. how to handle it
Re: disable some option in selectbox
Code: Select all
$omit = array('notanoption','whatever'); // values to omit from check box
// $result is an array containing key value pairs from database
foreach ($result as $key=>$value) {
if (in_array($value, $omit) ) { } // do nothing
else echo "<INPUT TYPE='checkbox' name='$key' value='$value'> </INPUT>";
}