Hi, If there's a webpage have 1)a Textbox 2)A form button If I want : if the textbox havent inputted anything, the form button is disable, how can I do this? Thanks.
Thanks everyone who helped me
Ken Shamrock
Ranch Hand
Joined: Jan 23, 2002
Posts: 139
posted
0
Also, it must work in Netscape, I know a method to work in IE but not in Netscape, as follows: <script language="javascript"> function test() { if (document.form1.textbox.value!="") document.form1.button.disabled = false; else document.form1.button.disabled = true; } </script> <form name="form1"> <input type="text" value="" name="textbox" onKeyup="test()"> <input type="button" name="button" value="Button" disabled> </form>
Do you want 'disabled' or 'doesn't work'? 'Disabled' I'm not so sure on, I'll have a look for the compatibility (it might not be supported in NS... 'Doesn't work' you can always achieve with client side validation. Dave