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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:38:32+00:00 2026-05-31T16:38:32+00:00

I am having serious trouble with trying to get all the forms on a

  • 0

I am having serious trouble with trying to get all the forms on a page to submit at once. Each of the forms (there could be anywhere from 1 to 100) are generated using partial views with mvc3. Each of the forms are generated using the @using (Ajax.BeginForm…. On the general ‘save’ button event handler in JS I have this code:

    var formsCollection = document.getElementsByTagName("form");

                for (var i = 0; i < formsCollection.length; i++) {

                    formsCollection[i].submit();
                }

Now, the mystifying and troubling part is that as written it only saves the last form in the last to the database. Yet, when I put an alert in that loop, both get saved!

To further complicate matters when I click the general ‘save’ button the browser jumps to a blank page. Now, I do have ‘return new EmptyResult()’ in the controller that handles the forms, but if I click the individual save buttons in the forms, it does not go to the blank page.

Any pointers in the right direction would greatly be appreciated.

  • 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-31T16:38:33+00:00Added an answer on May 31, 2026 at 4:38 pm

    Because you have a race condition. You are submitting two things at once, only one of them can actually make it.

    You need to rethink your design.

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

Sidebar

Related Questions

I'm having a small bit of trouble trying to get this piece of code
I´m having serious trouble to get Django to work with my Apache/mod_wsgi installation accessing
I'm having serious issues trying to get Mechanize to preserve the cookies set by
I'm having serious trouble figuring out what is making certain function calls ambiguous and
I'm having some serious trouble understanding the view matrix in XNA. I've come pretty
I am having some serious trouble creating a WPF TreeView with an Object databinding.
I'm having some serious trouble properly deploying Web Application Bundle (OSGi-fied WAR) on GlassFish
I am having some serious issues trying to tweak my layout in a table.
We have been having serious trouble getting an application we devlop running with UAC
I'm having serious trouble configuring my OpenLDAP server to have the memberOf overlay enabled.

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.