net_susan
asked on
Compare Validator Reacts Before Sumit is Clicked
This compare validator reacts as soon as a user types in the password, not even giving time to type in the password confirmation. How can I make it so this validator only reacts after submit is clicked?
<asp:comparevalidator id="comparepw" Runat="server" ControlToValidate="passwor d" controlToCompare="confirmp w">
Password and confirm password do not match!</asp:comparevalidat or>
<asp:comparevalidator id="comparepw" Runat="server" ControlToValidate="passwor
Password and confirm password do not match!</asp:comparevalidat
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks everyone!
Sorry, mixed up those stupid bool validators, but still, switching the controltocompare and the controltovalidate is a more efficient way because you don't have to wait for a postback event.
ASKER
If you see this, please explain what this means:
Sorry, mixed up those stupid bool validators,
I'm just a .NET baby. :)
Sorry, mixed up those stupid bool validators,
I'm just a .NET baby. :)
in my original post i said to use: EnableClientScript = "true"
then aki4u corrected me by saying: EnableClientScript="False"
I was copying code i previously used in which i wanted to force client scripting and forgot to change "true", a boolen (bool) value, to "False, the opposite boolean value.
then aki4u corrected me by saying: EnableClientScript="False"
I was copying code i previously used in which i wanted to force client scripting and forgot to change "true", a boolen (bool) value, to "False, the opposite boolean value.
ASKER
Ah, thanks!
ASKER
This will cause the validator to only fire when the submit button is clicked. Alternatively you can set the ControlToValidate and the ControlToCompare to be opposite:
ControlToValidate="confirm