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>"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.