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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:11:59+00:00 2026-05-27T16:11:59+00:00

I am attempting to use a JQuery dialog to popup a window upon let’s

  • 0

I am attempting to use a JQuery dialog to popup a window upon let’s say, an add button, which will therefore show a dialog with a Html.BeginForm() form within.

Either by using the buttons from the dialog, or putting a dialog within, I wish to submit the form, and then get the form back, either to show an update that the add is successful, or to show that there are some issues with the form (eg: server side errors)

EG:

public ActionResult EventSave(EventManageModel model)
{
        if (fake error, db save failed)
            ModelState.AddModelError("_FORM", "DB save failed!");
        return PartialView("EventManage", model);
}

I think I got the client side validation right, by using :

$.validator.unobtrusive.parse("#EventManage");

But my big question is actually server side validation/server side data retrieval. I don’t think Remote Validation works for me because this kind of errors would be more/less form-based errors instead of a specific textbox for example.

How can I get this to work? I have really no clue, I have tried theoretically everywhere to get this to work.

At the moment, when the dialog form submits, I have something like this:

      "Save": function () {
                    $.validator.unobtrusive.parse("#EventManage");

                    if ($("#EventManage").valid()) {

                        $.ajax({
                            url: "/Home/EventSave",
                            type: 'POST',
                            data: $("#EventManage").serialize(),
                            success: function (result) {
                                $("#EventManage").html(result);
                            },
                            error: function (result) {
                                $("#EventManage").html(result);
                            }
                        });
                    }
                },

I am not getting what I want however, the dialog doesn’t seem to be updating to and updated partial view, with no errors.

I am following this example actually, on how to get it to work:

http://iwantmymvc.com/dialog-form-with-jqueryui-and-mvc-3

Please give some tips on how to get this thing done? 🙂

EDIT:

My EventManage partial form:-

@model Harrods.Web.Models.EventManageModel


<div>
@using (Html.BeginForm("EventSave", "Home", FormMethod.Post, new { id = "EventManage", @class = "Dialog" }))
{
    @Html.ValidationSummary(false, "Please correct the errors below and try again:", new { @class = "ui-state-error ui-corner-all" })<br />
        <br />
        @Html.AntiForgeryToken()
        <fieldset>
        <legend>Event Details</legend>
        <br />
        @Html.Hidden("Id")
        <div class="editor-label-dialog">
            @Html.LabelFor(m => m.Event_Name)
        </div>
        <div class="editor-field-dialog">
            @Html.TextBoxFor(m => m.Event_Name)
            <br />
            @Html.ValidationMessageFor(m => m.Event_Name)
        </div>
        <p class="clear"></p>
        <br />
        <div class="editor-label-dialog">
            @Html.LabelFor(m => m.Event_Date)
        </div>
        <div class="editor-field-dialog">
            @Html.TextBoxFor(m => m.Event_Date)
            <br />
            @Html.ValidationMessageFor(m => m.Event_Date)
        </div>
        <p class="clear"></p>
        <br />
        <input type="submit" class="addNew" value="Save" />
        <div class='loading' style='display: none'><img src="@Url.Content("~/Assets/img/loading.gif")" title="Loading" /></div>
        </fieldset>
}
</div>

EDIT2

It seems like I got it to work for >> success: function (result)

but it doesn’t go into the error: function (result)

even though there’s already an error.

  • 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-27T16:11:59+00:00Added an answer on May 27, 2026 at 4:11 pm

    In order to show error messages that are not specific to some given input and that were added to the modelstate you could use the ValidationSummary helper. So put the following somewhere inside the partial:

    @Html.ValidationSummary(true)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use the jQuery UI dialog script in my Wordpress theme
I am attempting to use a Jquery menu, that makes use of the 'easeOutBounce'
I'm attempting to use the jQuery jFeed plugin for parsing an Atom, GeoRSS feed
I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6. This
I am attempting to create a jQuery plugin for my own use that can
I'm attempting to use jQuery to do a $.post() to an MVC controller action.
I'm attempting to use 'jQuery Validate' on a form that requires an email address
I am attempting to use Greasemonkey and jQuery 1.4.2. When I install the Greasemonkey
I am attempting to use the jCorner plugin for jQuery, but falling down at
I am attempting to use the jQuery mobile events without the rest of jQuery

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.