File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes onBlur problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onBlur problem?" Watch "onBlur problem?" New topic
Author

onBlur problem?

Santana Iyer
Ranch Hand

Joined: Jun 13, 2005
Posts: 335
I have few text boxes, all have same name.

On lost focus I show alert("Please enter value").
and set focus back to same text field.

But what happens is alert box comes continuosly.

I think this is because other control gets focus and loses focus since we say first control.focus but now since second control lost focus with empty value so it also raises alert.

It happens in cycle.
How to solve this problem.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
That is why I would never use onblur to force validation. You can get users stuck in loops.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onBlur problem?
 
Similar Threads
for attribute in Label element
focusing on an input element with jquery
alert msg on onchange event
What type of listener can i use, instead of FocusListener
JTable Column Validation