Question about RequiredFieldValidator

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?
 
K

Ken Cox [Microsoft MVP]

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?
 
P

Peter Chang

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top