How to call JavaScript function when replacing select tag?
Below is my javascript:
<script language="JavaScript"> function checkit() { var state=document.frm.getElementById(stateS) if (state="Please select a state") { document.frm.Month.disable = true; } else { document.frm.Month.enable = true; } }</script> and I call the checkit() function in it below the <select> :
<td align="left"><g:select name="Month" from="${month.values()}" optionValue="${Month}" onChange=checkit()/></td> </tr> I have a select tag for state, and until I select any state, the month selection field should be disabled. Can someone tell me where I was wrong?
+4
5 answers