validate on blur ?

K

Kevin Spencer

There is indeed an "onblur" event for an input type="text" form field. What
exactly do you want to know?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

For client side validation, this would be easy. To mix into the current .NET
framework validation is trickier (most likely subclass the validator with
custom script). There are events to put out JavaScript, but it is not as
easy as just dropping a control and setting properties.

There are support articles on setting focus, which can be used to work your
validation:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316719
http://support.microsoft.com/default.aspx?scid=kb;en-us;816166

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Z

z. f.

Hi,

i have input type=text and i want to make validation on the onblur (lost
focus) event.

i need to call some javascript function for validation with the control id .

is there something like that possible / documented?

TIA, z.
 
R

Rigs

If you want to execute javascript on the client, add this to your page_load:

'With <name of text box here>

'.Attributes.Add("onBlue", "<JavaScript Function Name ()>")

'End With

Within the <head> tag of your .aspx page, create your fuction to execute for
the onBlur event.
Thanks,
-Rigs

PS for Server side validation, I would use a Custom Validation control to
call a page behind sub or function.
 
R

Rigs

NOTE: Please remove the " ' " (apostrophes) from code. They were
accidently left in.
-Rigs
 
Z

z. f.

sorry i'll make myself more clear:

i'm using a dot net validator, the validator validates the input upon
submit.
i want to call some javascript method, so the validator make validation when
i call it.
is this possible?
 
K

Kevin Spencer

That I don't know. ASP.Net validator classes are designed to work a certain
way. I do my own custom validation, so I'm not as familiar with them as I
ought to be. However, I am reasonably sure that if an ASP.Net validator
Control doesn't do what you want, you could certainly write one that does.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top