Required field validator not validating

Rated 3.93/5 based on 860 customer reviews

I thought I'd clean out some unneeded code and replace the manual checking with Required Field Validator controls, but while they appear to be validating, they aren't preventing a postback.

Ie., I get my error messages displayed but the postback still occurs.

You can enabled/Disabled the Required Field Validator from the Javascript/j Query.

For your condition, When Checkbox is checked :- Just call the javascript function to enabled the Required Field Validator and when its Uncheck just disabled the Required Field Validator.

I've set the Control To Validate and it works flawlessly when there is no code inside the btn Submit Checkup_Click but if I try to put a code inside it, it will go forward and disregard the Required Field Validator.

which will make it not call the client side validation.

Once it comes to serverside validation, it's your job to make sure that no sensitive code is executed unless you want it to.

You can use it to make sure that the user has entered something in a Text Box control.

Let's give it a try, and add a Required Field Validator to our page.

The error occuring really is that it DOES validate if you don't fill in any code, but this might be because you can't tell that the button event was called regardless.

I have a textbox in a template field on a details view.

Leave a Reply