Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: obBlur () in Data Validation


Message #1 by "Howard Stone" <zzzing@a...> on Mon, 19 Feb 2001 21:40:28
This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C09B39.59BEC6D0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Are you sure you want to do the validation during the onBlur? I suggest 
validating the form just before submitting it. This allows the user to 
complete the form in any order they wish.


Cheers,

Anil Rhemtulla
Sevina Technologies


----- Original Message -----
From: "Howard Stone" <zzzing@a...>
To: "javascript" <javascript@p...>
Sent: Monday, February 19, 2001 9:40 PM
Subject: [javascript] obBlur () in Data Validation


> I am building a form and validating the data entered using JavaScript
> functions.  This is the function I use by attaching it to the onBlur() 

> event.
>
>                 function validateLastName() {
>       
>                     formObj =3D document.customerInfo;       
>                           if(formObj.lastName.value =3D=3D "") {
>                               alert("Last name is required");
>                                formObj.lastName.focus();
>
>                             } 
>                       }
>
> I discover that if the lastName field gets focus and I decide not to 
enter
> any data I am unable to get out of the text box unless I enter some 
text. 
> That is what I want.
>
> The problem is that if I click the clear form button I still cannot 
get
> out. I am thinking that the clear button should reset the form dut 
this is
> not happening.
>
> How do I resolve this?
>
> Thanks for your answer.
>
> Howard
>
>
$subst('Email.Unsub')
>
>



  Return to Index