sandy1028 Posted February 27, 2008 Share Posted February 27, 2008 How to remove the optgroup and enable the fields when option value Completed is selected. <select name='jobstatus'> <option value="--">-- <option value="R">Running <option value="C">Completed <option value="S">Suspended <option value="Q">Queued </select> <select name="cluster" onChange="if(this.options[this.selectedIndex].state=='disabled') this.selectedIndex=0"> <option value="--" selected>-- <? $clusters = clusterNames(); //array_shift($clusters); foreach($clusters as $c){ echo "<option value=\"$c\">$c</option>"; } echo "<optgroup label=\"Clusters down\">"; //echo "<optgroup label=\"Clusters down\">"; $clustersdown=disabledCluster(); foreach($clustersdown as $d){ echo "<option value=\"\" state=\"disabled\" style=\"color:#FF0000;\"><font color=\"#FF0000\">$d</font></option>"; } echo "</optgroup></select>"; Link to comment https://forums.phpfreaks.com/topic/93314-enable-and-disable/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.