I dont know if im postin in the right forum coz im not sure whether this is JS or PHP problem ..
my problem is i have a text field which is disabled and i need to enable it when the user selects specific option so this should be done through the id of the field but this field is generated in a while loop so only the first text field gets affected by my javascript function ..i know the id should be unique so how shall i implement this :
here's the code:
my problem is i have a text field which is disabled and i need to enable it when the user selects specific option so this should be done through the id of the field but this field is generated in a while loop so only the first text field gets affected by my javascript function ..i know the id should be unique so how shall i implement this :
here's the code:
Code:
function enable() { document.getElementById("demo1").disabled=false; } while($row=mysql_fetch_array($query)) { echo" <td> <select name=status onchange=enable()>";?> <option <?if($row[order_status]=='pending') echo "selected"?> >pending</option> <option <?if($row[order_status]=='shipped') echo "selected"?>>shipped</option> </td> <td><input type="text" id="demo1" name="date" value="<?echo $arr[0]?>" disabled="disabled"
Comment