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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:35:12+00:00 2026-06-04T18:35:12+00:00

I am having issues with ‘required field’ validation messages appearing on the target form

  • 0

I am having issues with ‘required field’ validation messages appearing on the target form when it appears after I issue an ajaxRequest.

I am executing the ajaxRequest command from within a form to allow a partial view to be rendered within a different form (the two form’s are on the same page and are actually panes of a Telerik splitter).

// note "MyAjaxCall is passed (below) so that I can populate
// the partial view with the model data
splitter.ajaxRequest(".t-pane:last", "/HierarchyMember/Edit/" + hierarchyId, {requestType: "MyAjaxCall" });

My controller simply get the appropriate model data and returns a partial view

return PartialView(hierarchyMemberRepository.Find(hierarchyMember.Id);

Then within my partial view (named “Edit”) I render via an Ajax.BeginForm (also note that on Ready because the form is dynamically loaded, I am reloading unobtrusive validation)

@using (Ajax.BeginForm("Edit"
    , "HierarchyMember"
    , new AjaxOptions { OnBegin = "ajaxOnBegin", OnFailure = "ajaxOnFailure()"
        , HttpMethod = "Post", InsertionMode = InsertionMode.Replace
        , OnSuccess = "ajaxOnSuccess(data, $('#submitButtonClicked')[0].value)"
        , OnComplete = "ajaxOnComplete" }
        , new { id = "editForm", name = "editForm" }))
{
  @Html.ValidationSummary(false)
  ...
}
<script...>
    $(document).ready(function () {
        var form = $("#editForm");
        // for validation
        form.removeData("validator").removeData("unobtrusiveValidation");
        $.validator.unobtrusive.parse(form);
    });
</script>

I am hence including jquery.validate.min.js, jquery.unobtrusive-ajax.min.js, jquery.validate.unobtrusive.min.js in my layout – within the ScriptRegistrar, I have tried the jQuery and jQueryValidation settings as true and false

<script src="@Url.Content("~/Scripts/2012.1.419/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftMvcValidation.js")" type="text/javascript"></script>
...
@(Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false).DefaultGroup(group => group.Combined(true).Compress(true)))

To enforce mandatory fields I have a partial class extending the EntityFramework’s generated model class as follows

[Required()]
public object HierarchyId;
[Required()]
public object HierarchyDescription;

Note that both of the above fields in SQL Server are defined as NOT NULL (within the Entity Framework (4.1) the IsNullable flag within the property attribute is false.

The problem I have is that when the partial view first appears, all mandatory fields on the form have a “…required field” error message shown (regardless of whether the field contains a value or not). If I exclude the partial class with the ‘Required’ attributes above, the error messages go away but I don’t get clientside validation (hence I can enter blanks in non-nullable fields)

Does anyone have a resolution to this?

  • 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-06-04T18:35:14+00:00Added an answer on June 4, 2026 at 6:35 pm

    For anyone wondering why the above occurred, it is because the AJAX call went via the HTTP post route in my controller that accepted the full structure which included some [Required] field decorations

    The resolution was to call a different method in the controller that accepted only those variables that were being passed and hence didn’t fail the validation and all was well

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

Sidebar

Related Questions

Im having issues vertically positioning text inside of a text input field in Firefox.
Im having issues with my JCarosel slider. My html is set up as required...
I'm having issues parsing some XML using DefaultHandler2. My XML takes the following form:
Im having issues deploying a silverlight 3 application for the first time. The issue
I´m having issues with my test cases after having introduced @Autowired in one of
I'm having issues customizing a radio button for a specific form using hook_theme. Below
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
I having issues with Codeigniter sessions dying on IE randomly, I search everywhere and
Still having issues with this problem. Please help if you can. So I am
Im having issues getting this to work, maybe its not even possible? I 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.