• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text field validation on exit

 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can I validate the contents of a text field on exiting the text field using java Script?
TIA.
Frank
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i remember having used the "onBlur" event for doing this.
<input type="text" value="somevalue" onBlur="return validate();">
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Swaroop
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use onChange since it will only be invoked when the user leaves the field (assuming the user made a change).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic