Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: Problem with onBlur event


Message #1 by "graham brown" <gbrown@c...> on Fri, 28 Sep 2001 13:39:54 +0100
Hi

I have a form which three controls which I am using to validate dates with a
simple piece of Javascript.

When the form is first loaded the dates are blank so invalid. The onblur
event traps this puts an alert up and sets the focus back.
The problem here is that both fields are invalid so javascript then proceed
to bounce back and forth without letting me correct the data so I have to
close the browser.

Is there a way to use onblur and check for a condition but without focus
actually leaving the field? The only other way I can think of is to use on
change and see if I can trap the tab key

Don't know if I am making this clear so if not then I'll post some code.

tia

Regards
Graham



  Return to Index