• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Urgent about javascript ,Thanks  RSS feed

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ken Shamrock
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.faqts.com/knowledge_base/view.phtml/aid/1747/fid/309
Hope this will help
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!