File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Urgent about javascript ,Thanks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Urgent about javascript ,Thanks" Watch "Urgent about javascript ,Thanks" New topic

Urgent about javascript ,Thanks

Ken Shamrock
Ranch Hand

Joined: Jan 23, 2002
Posts: 139
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
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;
document.form1.button.disabled = true;
<form name="form1">
<input type="text" value="" name="textbox" onKeyup="test()">
<input type="button" name="button" value="Button" disabled>
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

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.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Hope this will help
I agree. Here's the link:
subject: Urgent about javascript ,Thanks
It's not a secret anymore!