jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes How to use onBlur() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to use onBlur()" Watch "How to use onBlur()" New topic

How to use onBlur()

Rajpal Kandhari
Ranch Hand

Joined: Aug 26, 2000
Posts: 126
can any one tell me how and when to use onBlur() function?

Regards,<P>Raj.<BR>-------------------------<BR>Afforts should be Appriciated.<BR>-------------------------
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
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.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Prabhu Chandrasekaran
Ranch Hand

Joined: Oct 14, 2000
Posts: 36
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: How to use onBlur()
jQuery in Action, 3rd edition