Question about RequiredFieldValidator

  • Thread starter Thread starter pc
  • Start date Start date
P

pc

I've created a simple form with a submit button and a textfield. I
assigned a RequiredFieldValidator to the textfield and set
EnabledClientScript to ture. I noticed the validator did not display
the error message if the textfield was empty. It seems to me that the
client side validation script did not executed. After I pressed the
submit button, the validator displayed the error message. I tried
entering and clearing the textfield without pressing the submit button
and everything worked as described in the documentation. So my
question is why isn't the client side validation work the first time
(before pressing the submit button)? Is this by desgin?
 
Is it possible that the validator is detecting the browser as "downlevel" and
therefore not emitting the client-side script? If the browser version isn't
known to ASP.NET you may have problems like this.

Is there any evidence of the client-side script when you view the source of a
rendered page?

Ken


I've created a simple form with a submit button and a textfield. I
assigned a RequiredFieldValidator to the textfield and set
EnabledClientScript to ture. I noticed the validator did not display
the error message if the textfield was empty. It seems to me that the
client side validation script did not executed. After I pressed the
submit button, the validator displayed the error message. I tried
entering and clearing the textfield without pressing the submit button
and everything worked as described in the documentation. So my
question is why isn't the client side validation work the first time
(before pressing the submit button)? Is this by desgin?
 
I'm using IE 6. I don't think it has anything to do with the browser. Client
side validation work correctly after I pressed the submit button.
 
Back
Top