[RESOLVED] I want TextBox not to call the validation function when it loses the focus
Hi,
I have textbox and customvalidator, when the textbox loses the focus, the clientvalidationFunction and myCustomValidator_ServerValidate are called and the error message is displayed if the validation fails, what if I want the server and client validation functions to be called and validation error message displayed only when I click a certain button on the page and not when the textBox loses focus?
Thank you.
Re: I want TextBox not to call the validation function when it loses the focus
Set the textbox's CausesValidation property to false. Not sure if that's the right answer but try it.
Re: I want TextBox not to call the validation function when it loses the focus
I tried it, no luck either mister Mendhak.
Re: I want TextBox not to call the validation function when it loses the focus
Don't set the ControlToValidate property. On a PostBack the ServerValidate event(s) will still fire, giving you a chance to validate the entire page...
Not sure about the Client validation however...
Re: I want TextBox not to call the validation function when it loses the focus
thanks a lot, it works like a charm :)
Re: [RESOLVED] I want TextBox not to call the validation function when it loses the focus
It's odd that's worked for you, validators usually complain if you don't give it a ControlToValidate value.
Re: [RESOLVED] I want TextBox not to call the validation function when it loses the focus
Except the CustomValidator control. It is the only validator whose ControlToValidate property can be empty.
Re: [RESOLVED] I want TextBox not to call the validation function when it loses the f
Bruce learns something new every day. :afrog:
Re: [RESOLVED] I want TextBox not to call the validation function when it loses the focus
Amazing what you can learn when you RTFM.