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

  • Home
  • SEARCH
  • 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 7972701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:56:10+00:00 2026-06-04T07:56:10+00:00

I have a MVC3 page that is split into tabs. Each tab has a

  • 0

I have a MVC3 page that is split into tabs. Each tab has a partial view on it with an AJAX form with different ids.

@using (Ajax.BeginForm("Create1", "ControllerName", ajaxOptions, new { id = "frmCreate1" }))
...
@using (Ajax.BeginForm("Create2", "ControllerName", ajaxOptions, new { id = "frmCreate2" }))
...
@using (Ajax.BeginForm("Create3", "ControllerName", ajaxOptions, new { id = "frmCreate3" }))

Each tab has a save button on it with different ids.

<input type="submit" id="btnSave1" />
...
<input type="submit" id="btnSave2" />
...
<input type="submit" id="btnSave3" />
...

Each tab includes a javascript file that has handlers for the buttons:

// Submit Button
    $('#btnSave1').button({ label: "Save" });
    $('#btnSave1').click(function () {
        $.blockUI({ message: 'We are constructing your new Type 1, please wait just a moment...', theme: true, title: 'Saving' });
        $('frmCreate1').trigger('submit');
    });

...
// Submit Button
    $('#btnSave2').button({ label: "Save" });
    $('#btnSave2').click(function () {
        $.blockUI({ message: 'We are constructing your new Type 2, please wait just a moment...', theme: true, title: 'Saving' });
        $('frmCreate2').trigger('submit');
    });
...

// Submit Button
    $('#btnSave3').button({ label: "Save" });
    $('#btnSave3').click(function () {
        $.blockUI({ message: 'We are constructing your new Type 3, please wait just a moment...', theme: true, title: 'Saving' });
        $('frmCreate3').trigger('submit');
    });

Everything is submitting properly to the back end and it’s getting the data it needs from the form. However I changed the selector in the method to

$('#frmCreate1).trigger('submit');  

and now when running it the form gets submitted more than once causing me to jump in the debugger and subsequently post the same data twice.

I’m guessing that it’s submitting the form via Ajax with the right selector and then subsequently firing the actual submit for the form again but I’m not for sure what’s happening.

I want to make sure the code is correct in terms of what I’m really trying to do. These should be 3 single and separate submits. Do I change the “Submit” buttons to just button types instead of submit or should there be more in the javascript to prevent that second submit from happening? preventDefaults or something?

Thanks!

Edit: Should also include the Ajax Options, they occur on each and correspond to the tabs, they are all named differently but just in case the “Post” method had anything to do with this.

@{
    AjaxOptions ajaxOptions = new AjaxOptions
    {
        HttpMethod = "Post",
        UpdateTargetId = "tabs-1",
    };
}
  • 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-04T07:56:11+00:00Added an answer on June 4, 2026 at 7:56 am

    Re-posting my answer from the comments:

    The issue was that the submit button was actually submitting the form while the selector $('frmCreate1').trigger('submit'); was doing nothing since it didn’t return any elements. When the selector was made valid by adding the ‘#’ so that it looked for an id rather than a tag name, then that triggered the submit as well. Hence the double submit. If you pick one or the other that should stop the double submit.

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

Sidebar

Related Questions

I have an MVC3 app that has a details page. As part of that
I have a layout page within that layout I have used a partial view,
I have an ASP.NET MVC3 project that uses a tab strip on certain pages.
With ASP.NET MVC3 (Razor) I have a simple page that loads a jQuery UI
For a current MVC3 project I have a model that has multiple pages for
I have an MVC3 view that's design to run reports for our clients. In
This might be an odd question, but I have form in MVC3 that posts
I have two fields on an MVC3 form that must represent the same value.
Using ASP.net MVC3 with C# I want to create a partial view that uses
I have an mvc3 web page that takes a url parameter representing a date,

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.