RequiredFieldValidator not Stopping Form Submission

curlydog

Well-known member
Joined
Jul 5, 2010
Messages
50
Programming Experience
Beginner
This is odd, my requiredfieldvalidator have suddenly stopped working.

I have four relating to various controls (3x dropdownlists and 1 x textbox). Up until recently if the initial value were not changed when the submit button was clicked, the red error messages would appear the the routine handling the button click would be halted.

Suddenly, the error messages no longer appear and the routine handling the button click runs, even though both page.isValid = false and I have set one of the validators isValid property to false on page load.

The only thing I have done to the page is include a couple of other small forms on a side column of the page. Each of these have their own distinct validation Group. When I say forms, they physically look like seperate forms, but all lie within the same <form> tags.

Is this causing the problem?
 
Solved it. For those who may be encountering the same issue here's my solution.

The requiredfieldvalidators, and the controls they related to, were placed into a table. On close inspection, the tags of the table (<tr><td> etc) were badly formed. When I ensured that the tags were in the right places, and all had closing tags, the validators started working again.
 
Back
Top