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 7050479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:08:55+00:00 2026-05-28T03:08:55+00:00

Something strange is happening here. I have a basic form: <% using (Html.BeginForm()) {

  • 0

Something strange is happening here.

I have a basic form:

    <% using (Html.BeginForm())
       { %>
       <%: Html.LabelFor(model => model.user.email) %>
       <%: Html.TextBoxFor(model => model.user.email) %>
       <%: Html.ValidationMessageFor(model => model.user.email) %>
       <br />
       <%: Html.LabelFor(model => model.user.password) %>
       <%: Html.PasswordFor(model => model.user.password) %>
       <%: Html.ValidationMessageFor(model => model.user.password) %>
       <br />
       <%: Html.LabelFor(model => model.user.confirmPassword) %>
       <%: Html.PasswordFor(model => model.user.confirmPassword) %>
       <%: Html.ValidationMessageFor(model => model.user.confirmPassword) %>
       <br />
       <input type="submit" value="Submit" />
    <% } %>

The head has the following:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<link rel="Stylesheet" type="text/css" href="/Content/Site.css" />
<script src="/Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>

The ViewModel is this:

public class RegisterViewModel
{
    public RegisterUser user { get; set; }
}

public class RegisterUser
{
    [Required]
    [Display(Name = "Email Address")]
    public string email { get; set; }

    [Required]
    [Display(Name = "Password")]
    public string password { get; set; }

    [Required]
    [Display(Name = "Confirm Password")]
    [Compare("password")]
    public string confirmPassword { get; set; }
}

The compare validation between password and confirmPassword always says:
‘Confirm Password’ and ‘password’ do not match.
even when I know that they do match

Here’s the strange part: when I remove the first field from the view page, everything works.

So when it’s just

<% using (Html.BeginForm())
   { %>
   <%: Html.LabelFor(model => model.user.password) %>
   <%: Html.PasswordFor(model => model.user.password) %>
   <%: Html.ValidationMessageFor(model => model.user.password) %>
   <br />
   <%: Html.LabelFor(model => model.user.confirmPassword) %>
   <%: Html.PasswordFor(model => model.user.confirmPassword) %>
   <%: Html.ValidationMessageFor(model => model.user.confirmPassword) %>
   <br />
   <input type="submit" value="Submit" />
<% } %>

it all works perfectly.

Any ideas?

Thanks.

  • 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-28T03:08:56+00:00Added an answer on May 28, 2026 at 3:08 am

    This is a bug in the client side validation script: jquery.validate.unobtrusive.js

    At Line ~284 you’ll find this:

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

    Change it to this:

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

    The name attribute needs single quotes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Something strange is happening in my code where I'm using a StackTrace. It's almost
I realize it's probably something strange, but here is what I have. I have
I must be missing something quite obvious here because something rather strange is happening
I'm seeing something very very strange happening in a Flex app I'm maintaining. I've
I'm getting something pretty strange going on when trying to read some data using
I'm experiencing something really strange! I have a div that I'm hiding with JS
i have a strange situation may its a easy fix or something i may
I have a strange problem when deleteting records using linq, my suspicion is that
Something really weird is happening to my Rails app. For some strange reason, jQuery
I downloaded the latest pyrocms zip file and I noticed something strange happening. On

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.