aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Urgent about javascript ,Thanks" Watch "Urgent about javascript ,Thanks" New topic
Author

Urgent about javascript ,Thanks

Ken Shamrock
Ranch Hand

Joined: Jan 23, 2002
Posts: 139
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
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>
David O'Meara
Rancher

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

Joined: Feb 02, 2001
Posts: 413
http://www.faqts.com/knowledge_base/view.phtml/aid/1747/fid/309
Hope this will help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent about javascript ,Thanks