Jump to content

Enable and disable


sandy1028

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.