• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use onBlur()

 
Rajpal Kandhari
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HEllo,
can any one tell me how and when to use onBlur() function?
Regards
Raj.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
onBlur is usually used for field validation, or updating dependent fields. Imagine a form with three text fields and a total. While you are editing one of the fields, you don't want the total to change, but you don't want to have to press a button to update it either. So set the onBlur() handler of each of the input fields to a method which updates the total. Now whenever you move out of a field, th etotal will be updated.
 
Prabhu Chandrasekaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The onBlur event is executed when the object loses its focus,
ie., when the cursor is moved from the current object to any other object in the form.
This is normally used for validation or object value updation.
Bye,
Prabhu.V.C
------------------
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic