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 Problem in validatation in text filed. 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 "Problem in validatation in text filed." Watch "Problem in validatation in text filed." New topic

Problem in validatation in text filed.

Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
I need a HELP IN JAVASCRIPT VALIDATION at the time of insertion in the text field..

I need to validate suppose 4 text boxes.- should not be empty, only numeric in a range or character, etc
I am using onBlur() as a event attribute in each text box.

But i am facing problem , when there is an empty filed

if(some condition){;
return false;
return true;

But, the control moves to next box too. or it is triggerd every time , alert will remain there.

should i use different trigger for that?

If i change the order of the text box ,i.e., added non-validate text box, it works fine.


Abhijit Das
SCJP 5.0 | SCWCD 1.5
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
what does the full call for this validation look like?

I agree. Here's the link:
subject: Problem in validatation in text filed.
It's not a secret anymore!