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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:04:34+00:00 2026-05-29T11:04:34+00:00

I am using MVC3 and added model validation with required attributes. Then I have

  • 0

I am using MVC3 and added model validation with required attributes. Then I have created page which has jquery dialog (not ajax dialog). Validation does not work in that case. But if I put html from dialog to page it works fine.

Does any body know how to solve problem?

Here is my JavaScript:

$(document).ready(function () { 
  $("#registerDialog").dialog({ autoOpen: false, show: "blind", hide: "explode", modal: true, resizable: false, height: 570, width: 390 });

  $(".headerButton").button(); 
  $(".accountBtn").button(); 
  $('ul').roundabout({ autoplay: 'false', autoplayDuration: 3000 }); 

  $("#registerBtn").click(function () { 
    $("#registerDialog").dialog("open"); return false; }); 
    $("#closeRegisterDialog").click(function () { $("#registerDialog").dialog("close"); 
   }); 

   $("#registerBtnSbmt").click(function () {
     $("#registerForm").submit(); return false; }); 
   })



@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id = "registerForm" }))
{       

    <div id="registerDialog" title="Регистрация">
        @Html.LabelFor(x => x.FirstName)
        <br/>
        @Html.TextBoxFor(x => x.FirstName, new { @class = "registerUser" })
        <br/>
        @Html.ValidationMessageFor(x => x.FirstName)          
        <br/>
        @Html.LabelFor(x => x.LastName)           
        <br/>
        @Html.TextBoxFor(x => x.LastName, new { @class = "registerUser" })            
        <br/>
        @Html.ValidationMessageFor(x => x.LastName)          
        <br/>
        @Html.LabelFor(x => x.Email)           
        <br/>
        @Html.TextBoxFor(x => x.Email, new { @class = "registerUser" })           
        <br/>
        @Html.ValidationMessageFor(x => x.Email)           
        <br/>
        @Html.LabelFor(x => x.Password)           
        <br/>
        @Html.TextBoxFor(x => x.Password, new { @class = "registerUser" })           
        <br/>
        @Html.ValidationMessageFor(x => x.Password)          
        <br/>
        @Html.LabelFor(x => x.ConfirmPassword)           
        <br/>
        @Html.TextBoxFor(x => x.ConfirmPassword, new { @class = "registerUser" })            
        <br/>
        @Html.ValidationMessageFor(x => x.ConfirmPassword)                                   
        <br/>
        @Html.CheckBoxFor(x => x.RememberYou) запомнить Вас?                        
        <br/>
         <br/>
        @Html.ActionLink("Сохранить", "LogIn", "Account", null, new { @class = "accountBtn", style = "font-size: 0.8em;", id = "registerBtnSbmt" })
       <a href="#" class="accountBtn" id="closeRegisterDialog" style = "font-size: 0.8em;">Закрыть</a>
    </div>
}
  • 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-29T11:04:35+00:00Added an answer on May 29, 2026 at 11:04 am

    You need to move your form tags inside of your dialog. You will notice when you create the dialog and open it, it moves your div out of your form. You would want:

    <div id="registerDialog" title="Регистрация">
        @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id = "registerForm" }))
        {       
    
            @Html.LabelFor(x => x.FirstName)
            <br/>
            @Html.TextBoxFor(x => x.FirstName, new { @class = "registerUser" })
            <br/>
            @Html.ValidationMessageFor(x => x.FirstName)          
            <br/>
            @Html.LabelFor(x => x.LastName)           
            <br/>
            @Html.TextBoxFor(x => x.LastName, new { @class = "registerUser" })            
            <br/>
            @Html.ValidationMessageFor(x => x.LastName)          
            <br/>
            @Html.LabelFor(x => x.Email)           
            <br/>
            @Html.TextBoxFor(x => x.Email, new { @class = "registerUser" })           
            <br/>
            @Html.ValidationMessageFor(x => x.Email)           
            <br/>
            @Html.LabelFor(x => x.Password)           
            <br/>
            @Html.TextBoxFor(x => x.Password, new { @class = "registerUser" })           
            <br/>
            @Html.ValidationMessageFor(x => x.Password)          
            <br/>
            @Html.LabelFor(x => x.ConfirmPassword)           
            <br/>
            @Html.TextBoxFor(x => x.ConfirmPassword, new { @class = "registerUser" })            
            <br/>
            @Html.ValidationMessageFor(x => x.ConfirmPassword)                                   
            <br/>
            @Html.CheckBoxFor(x => x.RememberYou) запомнить Вас?                        
            <br/>
             <br/>
            @Html.ActionLink("Сохранить", "LogIn", "Account", null, new { @class = "accountBtn", style = "font-size: 0.8em;", id = "registerBtnSbmt" })
           <a href="#" class="accountBtn" id="closeRegisterDialog" style = "font-size: 0.8em;">Закрыть</a>
        }
    </div>
    

    There is an explanation of why this happens at the bottom of this page

    From the page:

    One of the requirements of the dialog is that it appear as the
    top-most element. The only way to accomplish this consistently in
    Internet Explorer is to have the dialog be the last element in the
    body, as it respects DOM order over z-index. There are generally two
    work-arounds:

    move the dialog element back somewhere else in the dom in the open event callback. This has the potential to allow other elements to
    

    appear on top of the dialog (see above)

    move the dialog content element somewhere else in the dom in the close event callback, before the submit. 
    

    Neither of these are suitable for building in to the dialog, and are
    left as suggested work-arounds. As the first comment on this ticket
    suggests, this needs to be documented better.

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

Sidebar

Related Questions

I'm using ASP.NET MVC 3 code-first and I have added validation data annotations to
I am developing an MVC3 application using Visual Studio 2010. I have an aspx
we are developing a web application using MVC3 and VS2010. We have some pdf
I'm new to MVC3 and have been working on a small site using EF
I have a C#.NET MVC3 web app and I have some common jQuery functionality
I using MVC3 and I have a form with a file upload. If the
Using MVC3 and the StringLength validation attribute on a property of type MyType<string> who's
I have written a jquery ajax function that I have added to js file
Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have

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.