Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:14:14+00:00 2026-05-25T14:14:14+00:00

I have two email fields on a form to validate that the user entered

  • 0

I have two email fields on a form to validate that the user entered his email properly. However, jquery.validate.unobtrusive always shows an error message even when the email is entered twice correctly.

This is an ASP.Net MVC 3 project, and I am using the Compare Attribute on the second email field.

Here is the html code of that region on my web page:

<div class="editor-field">
    <input class="text-box single-line" data-val="true" data-val-length="The field Adresse de courriel must be a string with a maximum length of 50." data-val-length-max="50" data-val-required="L&amp;#39;adresse de courriel doit &amp;#234;tre sp&amp;#233;cifi&amp;#233;e" id="Requerant_Individu_Courriel" name="Requerant.Individu.Courriel" type="text" value="" />
    <span class="field-validation-valid" data-valmsg-for="Requerant.Individu.Courriel" data-valmsg-replace="true"></span>
</div>
<div class="editor-field">
    <input class="text-box single-line" data-val="true" data-val-equalto="Les deux adresses de courriel doivent &amp;#234;tre identiques" data-val-equalto-other="*.Courriel" data-val-required="L&amp;#39;adresse courriel de confirmation doit &amp;#234;tre sp&amp;#233;cifi&amp;#233;e" id="Requerant_Individu_ConfirmCourriel" name="Requerant.Individu.ConfirmCourriel" type="text" value="" />
    <span class="field-validation-valid" data-valmsg-for="Requerant.Individu.ConfirmCourriel" data-valmsg-replace="true"></span>
</div>

I noticed this attribute on the second email input: data-val-equalto-other=”*.Courriel”
I am wondering whether that asterisk is correct.

And here is what I have in my model:

    [Required(ErrorMessage = "L'adresse de courriel doit être spécifiée")]
    [StringLength(50)]
    [Display(Name = "Adresse de courriel")]
    public String Courriel { get; set; }

    [Compare("Courriel", ErrorMessage = "Les deux adresses de courriel doivent être identiques")]
    [Required(ErrorMessage = "L'adresse courriel de confirmation doit être spécifiée")]
    [Display(Name = "Retapez votre adresse de courriel")]
    public string ConfirmCourriel { get; set; }

Anyone has ever encountered that problem? Suggestions?

Note: I am using jQuery 1.6.3 and jQuery Validation Plugin 1.8.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:14:14+00:00Added an answer on May 25, 2026 at 2:14 pm

    I finally found the answer to my problem on this post:

    JQuery 1.5 breaks Compare Validate (JQuery Validate 1.8)

    In file jquery.validate.unobtrusive.js, line 288:

    element = $(options.form).find(":input[name=" + fullOtherName + "]")[0];
    

    has to be replaced with this code:

    element = $(options.form).find(":input[name='" + fullOtherName.replace(".", "\\.").replace("[", "\\[").replace("]", "\\]") + "']")[0];
    

    Same thing for line 309:

    return $(options.form).find(":input[name='" + paramName + "']").val();
    

    which has to be replaced by:

    return $(options.form).find(":input[name='" + paramName.replace(".", "\\.").replace("[", "\\[").replace("]", "\\]") + "']").val();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope I can explain this right I have two input fields that require
I have a bunch of name/email fields in my form like this: data[Friend][0][name] data[Friend][1][name]
I have two form elements on my page that act as a smooth login
I have two collections which have property Email in both collections. I need to
I have two constructor : function clsUsagerEmailUserName($nickName, $email) { $this->nickName = $nickName; $this->email =
I have two applications written in Java that communicate with each other using XML
I have the following admin setup so that I can add/edit a user and
I have a form with two text_fields: <input type=text id=post_name name=post[name] /> <input type=text
I have a form that inherits from 2 other forms. In my form, I
I have a User model with the usual information (login, email, name, location, etc).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.