HTML input text field on Does not work
Here is what I have:
<script language="JavaScript"> function toggle() { if (this.value=='1') { document.getElementById('dbOn').style.visibility='visible'; } else { document.getElementById('dbOn').style.visibility='hidden'; document.getElementById('dbOff').checked='checked'; } } </script> <form action="index" method="post"> <input type="text" name="iterations" value="1" onChange="toggle()" > <input type="radio" name="db" value="OFF" checked="checked" id="dbOff" >OFF<br> <input type="radio" name="db" value="ON" id="dbOn" >ON </form> The idea is that you will only be allowed to write to the database if you are doing one iteration. Otherwise, I want the βONβ option to be disabled or disappear, and the βOFFβ flag checked automatically.
So far I have tried onChange, onKeyUp and onKeyPress, but none of them work. Any ideas what is wrong with my code?
thanks