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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:29:39+00:00 2026-05-27T06:29:39+00:00

I have a form in a partial view with a required field. I try

  • 0

I have a form in a partial view with a required field. I try to submit the form and get a validation error which is the expected behaviour. Now I fill out the required field and submit the form and my controllerAction replaces the partial view.

Now I empty the required field again and try to submit again – and the form is submitted. I get validation error tough but my page is sending a POST-Request.

What’s happenig here?

EDIT

Zruty gave the correct answer, I updated my ajaxSetup:

$j.ajaxSetup({
    statusCode: {
        200: function (data, textStatus, jqXHR) {
            $.validator.unobtrusive.parse(document);
        }
    }
});
  • 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-27T06:29:39+00:00Added an answer on May 27, 2026 at 6:29 am

    The ‘unobtrusive JavaScript validation’ feature of MVC3 is powered by jquery.validation plugin.

    Once the page is loaded, its DOM is parsed completely to account for all the validation attributes.

    Obviously, when you expand the DOM afterwards, the validation plugin will not automagically account for those added rules.

    You can force a re-analyzing of your DOM document by calling $.validator.unobtrusive.parse(document) after you have finished modifying the DOM:

        $.get("somedata.html", {}, function (data) {
            $("div.ajax-loaded").html(data);
            $.validator.unobtrusive.parse(document);
        }, "html");
    

    EDIT: I never used AjaxHelper for my AJAX communication, but it appears that you can easily slip your after-request processing into AjaxOptions.OnSuccess parameter:

    @using(Ajax.BeginForm("Action", 
        new AjaxOptions { OnSuccess = "successCallback" }))
    {
        ...
    }
    <script type="text/javascript">
        function successCallback(ajaxContext){
            $.validator.unobtrusive.parse(document);
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.Net MVC. I have a partial view which has a form
I have a form which is part of a partial view and I need
if i have created a view model and have a partial form that is
I have the following form in a partial view @model PartDetail @using (Ajax.BeginForm(Create, Part,
I have a one form tag inside my Index.aspx view. Index.aspx contains several partial
I have multiple pages containing the same partial view. The partial contains a form
I have a partial view which is displayed on a non-HTTPS page, but POSTS
Inside of an asp.net mvc partial view, I have an Ajax form that posts
i have a partial view with a login form (with username and password fields)
I have a contact viewmodel which I use to strongly type my partial view

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.