[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Enable on submit button after text entered

Posted on 2004-11-18
2
Medium Priority
?
368 Views
Last Modified: 2012-06-21
Ive got a single search field and button.  I want to load the submit button disable by default, and then enable it only if text is entered into the search field.  I also need to disable it again if the text is deleted.  Can this be done with javascript?
0
Comment
Question by:soBC
2 Comments
 
LVL 2

Accepted Solution

by:
java_programmer earned 1600 total points
ID: 12616390
yep, just add a function to the text area onKeyUp="checkIt(this.form)"

then define checkIt(myForm) as:
if (myform.textfield.value="") then myform.submitbutton.enabled=false
else
myform.submitbutton.enabled=true

that is it... syntax may need a bit a tweaking, but pretty much that will work.
Derek
0
 

Author Comment

by:soBC
ID: 12616641
disco.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month20 days, 6 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question