IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes URGENT!  java script validation using onBlur Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "URGENT!  java script validation using onBlur" Watch "URGENT!  java script validation using onBlur" New topic
Author

URGENT! java script validation using onBlur

ramu av
Greenhorn

Joined: Feb 25, 2003
Posts: 28
URGENT! java script validation using onBlur
hello evy body,
the following code is to vakidate text boxes immediately as their focus is lost onChange is not the solution i'm looking for. the following code is ending up in a loop. please analyse this help me out.
thanx in advance.
ramu
im not able to post you the html code please bear with me.
John Hembree
hired gun
Ranch Hand

Joined: Mar 07, 2003
Posts: 250
obviously we don't have the html to see how it's written, so with that in mind...
It looks like your onBlur events will be fighting with your code in your check function. Each function j,f,m have commmands to set the focus in their respective textbox, then check comes along and cycles thru each function, as check calls j which sets the focus to j textbox, check moves to f, which if false sets focus to f textbox, which fires j onblur event, do you see what I mean.
I would either remove the check function since you should never need to check them if your checking them before you leave individually or comment the setfocus lines in j,f,m so that they don't fight with check function.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
Well in your first function you are returning true when you want it to be false.
The reason why is you are never reassigning true to the values. You need an else statement that returns true.
And instead of doing if(blah == false), I would just do
if (!blah)

You might want to be interested in my validation project I am working on. It is still in the works, but whould have a very good version up soon. It is still in testing. Link is in my signature.
Eric
 
 
subject: URGENT! java script validation using onBlur
 
Threads others viewed
How to reference a variable of jsp in the script function?
URGENT Help needed on JavaScript.
Need Help With Dynamic text box in JSP
VERY urgent help me please
Validate
MyEclipse, The Clear Choice