validate on blur ?

  • Thread starter Thread starter Kevin Spencer
  • Start date Start date
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.
 
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!
************************************************
 
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.
 
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.
 
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?
 
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.
 
Back
Top