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 Text field validation on exit 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 "Text field validation on exit" Watch "Text field validation on exit" New topic

Text field validation on exit

Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
Can I validate the contents of a text field on exiting the text field using java Script?
swaroop shastri
Ranch Hand

Joined: Aug 15, 2001
Posts: 65
i remember having used the "onBlur" event for doing this.
<input type="text" value="somevalue" onBlur="return validate();">
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
Thanks Swaroop
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You can also use onChange since it will only be invoked when the user leaves the field (assuming the user made a change).

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Text field validation on exit
Similar Threads
Positioning the cursor in an input field
SchemaExportTask query
inherting classes avalibile i jar
How to disable the right click button in Textfield o HTML form with NN4
JInternalFrame to get Focus