I have a form that contains two fields input
, one for the email and another to re-enter the mail and validate that they are the same, for this last I use the CompareValidator but it does not show me the error when switching focus to the send button
The following is the Email field
<asp:Label ID="Label3" Text="Correo electrónico" ToolTip="Correo electrónico" runat="server" /><span class="campoObligatorio">*</span>
<input id="txtCorreo" type="text" maxlength="100" placeholder="Ej: [email protected]" title="Correo electrónico" runat="server" autocomplete="off" validationgroup="vgrCapturaDatos" />
<asp:RequiredFieldValidator ID="rfvCorreo" CssClass="errorCaptura" ValidationGroup="vgrCapturaDatos" Text=" " ErrorMessage="El Correo electrónico es obligatorio" ControlToValidate="textoCorreo" runat="server" />
<asp:RegularExpressionValidator ID="regexEmailValid" CssClass="errorCaptura" runat="server" ValidationGroup="vgrCapturaDatos" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="textoCorreo" Text=" " ErrorMessage="Formato de correo no valido"></asp:RegularExpressionValidator>
The following is the field to be validated
<asp:Label ID="Label6" Text="Valide su Correo electrónico" ToolTip="Correo electrónico" runat="server" /><span class="campoObligatorio">*</span>
<input id="txtValidaCorreo" type="text" maxlength="100" placeholder="Ej: [email protected]" title="Valida correo electrónico" runat="server" autocomplete="off" validationgroup="vgrCapturaDatos"/>
and the following is the validator to compare
<asp:CompareValidator ID="cfvNumeroCelular" runat="server" ControlToCompare="txtCorreo" ControlToValidate="txtValidaCorreo" Operator="Equal" Type="Integer" Display="Dynamic" ValidationGroup="vgrCapturaDatos" ErrorMessage="El valor ingresado no coincide." ></asp:CompareValidator>
However when I pass the focus to the next control or send the form, it does not validate and passes right so the values are different. I appreciate your help and collaboration to be able to know where I have the error.