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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:21:51+00:00 2026-05-29T22:21:51+00:00

I am having a problem with a form that is inside of a jquery

  • 0

I am having a problem with a form that is inside of a jquery dialog not posting in IE.

It works fine in chrome and FF, sending data to my MVC controller, but send null values from IE.

I did get it to work one way though by calling an alert to display the serialize result. That causes the form to serialize correctly and the send values to the server.

$("<div id='formModal'><img src='../../Content/images/ajax-loader.gif' /></div>")
                    .addClass("dialog")
                    .attr("id", $(this).attr("data-dialog-id"))
                    .appendTo("body")
                    .dialog({
                        width: 800,
                        position: [300, 50],
                        title: $(this).attr("data-dialog-title"),
                        close: function () { $(this).dialog('destroy').remove(); window.location.reload(true); },
                        modal: true,
                        buttons: {
                            "Save": function () {
                                var formdata = $("#timeForm").serialize();
                                $.post("/TimeTracker/AddTime",
                                    $("#timeForm").serialize());
                                alert(formdata);
                                $(this).dialog("close");
                                $(this).dialog("destroy");
                                window.location.reload(true);
                                return false;
                            },
                            Cancel: function () {
                                $(this).dialog("close");
                                $(this).dialog("destroy");
                            }
                        }
                    })
                .load(this.href);

Once I remove the alert, the form no longer has serialized values.

Is this an error in my JQuery scripting? Or something else?

  • 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-29T22:21:53+00:00Added an answer on May 29, 2026 at 10:21 pm

    You have close event handler for dialog box which is reloading the page window.location.reload(true) whenever you close the dialog.

    And on button Save you are doing so many things, posting the form, closing the dialog and again reloading the page.

    If you really want to reload the page after posting the form then wait until post responds. You can write your code inside its success handler. Also reloading the page will anyways close the handler so you don’t have to call $(this).dialog("close") which will trigger the close event and again reload the page.

    Try this.

              buttons: {
                            "Save": function () {
                                var formdata = $("#timeForm").serialize();
                                $.post("/TimeTracker/AddTime",
                                    formdata, function(){
                                    window.location.reload(true);
                                });
                                //alert(formdata);
                                //$(this).dialog("close");
                                //$(this).dialog("destroy");
                                //window.location.reload(true);
                                return false;
                            },
                            Cancel: function () {
                                $(this).dialog("close");
                                $(this).dialog("destroy");
                            }
                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problem that when i am trying to submit the form by
I'm having a little problem with jQuery: I'm having .submit() defined on a form,
I need to do a form validation with jQuery. But I'm having a problem
Inside of an asp.net mvc partial view, I have an Ajax form that posts
I am having problem with Yii and jQuery mobile. The problem is that jQuery
I am having a problem with a form submitted in MVC. it is able
Having problem with jquery submit(). The problem is that it doesn't work on the
Having a problem where the form submits before the validateUsername function has a chance
I'm having a problem with a simple form where i'm attempting to fire an
I am having a problem assigning a default value to my Spring Form input

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.