Reputation: 7557
I am creating a register form and when the user clicks on the confirm password field, the page refreshes and I lose the text from the other field (the password field)
The code to the confirm password is here below:
<asp:RequiredFieldValidator ValidationGroup="CreateAccount1"
CssClass="FieldValidator" EnableClientScript="true"
ControlToValidate="TxtPass" ID="pPassword" runat="server"
Text="Password required" ErrorMessage="Password required" />
Thanks, C.
Upvotes: 0
Views: 789
Reputation: 263047
It looks like the AutoPostBack property of your first password field is set to true
. In that case, the page will be posted back to the server as soon as that field loses focus, bypassing client validation.
You might want to set that property to false
instead.
Upvotes: 1