Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How to check validation in textbox


Message #1 by oranee suwanjesda <oranee@y...> on Thu, 25 Jan 2001 15:58:13 -0800 (PST)
Hi All!

     First, Thanks very much. I also have another

problem. If in my page have 3 textboxes..  I want user

put "ONE" in first textbox, "TWO" in second textbox,

"THREE" in the third.. In the same time, for each

textbox, it will check immediately that it's valid

data, or not.. If it 's not, the user can't move to

the next text box.. How can I do it? 

Thanks very very much in advance

Regs,

Moo

Message #2 by gary@e... on Fri, 26 Jan 2001 13:22:16 -0000
Hi Moo,

  If textboxOne has not got valid content use textboxOne.focus at the end

of the validation routine to place the curser back in it. Since the

validation routine will be called again if the user moves the curser

(using the textboxOne onchange event) this will happen everytime, until

the data is valid.



	If(notvalid)

		textboxOne.focus

	End If



gary@e...



> Hi All!

>      First, Thanks very much. I also have another

> problem. If in my page have 3 textboxes..  I want user

> put "ONE" in first textbox, "TWO" in second textbox,

> "THREE" in the third.. In the same time, for each

> textbox, it will check immediately that it's valid

> data, or not.. If it 's not, the user can't move to

> the next text box.. How can I do it? 

> Thanks very very much in advance

> Regs,

> Moo

Message #3 by "Mike Scott" <jstmehr4u3@h...> on Sat, 27 Jan 2001 20:38:50 -0800
YUou also can use the LostFocus() event of the text box. This will trigger

your validation routine when the focus is left from the text box. The

problem is that you can get the user in a LOOP if you constantly reset the

focus to the text box. Do your validation routine once, on lost focus, and

then at the time of submittal. This will keep data integrity, and also the

user wont get mad and leave your page.

----- Original Message -----

From: <gary@e...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Friday, January 26, 2001 5:22 AM

Subject: [asp_web_howto] Re: How to check validation in textbox





> Hi Moo,

>   If textboxOne has not got valid content use textboxOne.focus at the end

> of the validation routine to place the curser back in it. Since the

> validation routine will be called again if the user moves the curser

> (using the textboxOne onchange event) this will happen everytime, until

> the data is valid.

>

> If(notvalid)

> textboxOne.focus

> End If

>

> gary@e...

>

> > Hi All!

> >      First, Thanks very much. I also have another

> > problem. If in my page have 3 textboxes..  I want user

> > put "ONE" in first textbox, "TWO" in second textbox,

> > "THREE" in the third.. In the same time, for each

> > textbox, it will check immediately that it's valid

> > data, or not.. If it 's not, the user can't move to

> > the next text box.. How can I do it?

> > Thanks very very much in advance

> > Regs,

> > Moo

>

  Return to Index