I wrote the following code on an aspx page in asp.net c # application
<section>
<label>
<asp:Label ID="lblPassword" runat="server" Text="Password *"></asp:Label></label>
<label class="input">
<asp:TextBox ID="txtPassword" TextMode="Password" runat="server" data-content="Please Enter Your Password?" data-rel="popover" data-original-title="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvPassword" runat="server" Display="Dynamic" CssClass="state-error" ValidationGroup="profile" SetFocusOnError="true"
ControlToValidate="txtPassword">please enter password</asp:RequiredFieldValidator>
</label>
</section>
<section>
<label>
<asp:Label ID="lblConfirmPassword" runat="server" Text="Confirm Password *"></asp:Label></label>
<label class="input">
<asp:TextBox ID="txtConfrimPassword" TextMode="Password" runat="server" data-content="Please Confirm Your Password?" data-rel="popover" data-original-title="Confrim Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" ValidationGroup="profile" SetFocusOnError="true"
CssClass="state-error" ControlToValidate="txtConfrimPassword">Please re-enter your password</asp:RequiredFieldValidator>
<asp:CompareValidator runat="server" ID="valComPassword" CssClass="state-error" ControlToValidate="txtPassword" ControlToCompare="txtConfrimPassword"
Display="Dynamic" ValidationGroup="profile" SetFocusOnError="true" ErrorMessage="Confirm password does not match"></asp:CompareValidator>
</label>
</section>
Now the problem is when the user enters his password in the text box txtPassword
, a confirmation (password confirmation) appears below the text box txtConfirmPassword
. I want it to appear after the user enters their incorrect password in the text box txtConfirm
.
user2179026
source
share