I’m using a RegularExpressionValidator in ASP.NET on a textbox that requires 10 numbers as input. My problem is that the error message pops up whenever I switch to a different control. For example: when I enter only 1 number and then switch to a different textbox the error message tells me that I need 10 numbers.
I would like for the REV to only validate when the submit button is pressed. I have tried to add “CauseValidation=False” to the textbox but this didn’t solve the problem.
Anyone know the answer?
Thanks
In order to avoid disabling the client script entirely (by setting
EnableClientScript="False"). You could try handling thechangeevent of the TextBox which has the validation control attached. hiding the validation message which may or may not have been displayed.Then on sumbmit of the form the validator would still be called and displayed if necessary.