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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:05:29+00:00 2026-06-05T22:05:29+00:00

I am trying to submit two forms at once (one goes to db and

  • 0

I am trying to submit two forms at once (one goes to db and the other goes to fpdf to make labels). I use jquery to copy the variables from the first form to hidden inputs on the second form. I have seen this question asked a couple times on here but none of the answers have helped. I use the ‘fake’ ajax method – ie: I set the form target to a hidden iframe on the same page. So I want to submit one form, then use a delay then submit the second form (because it’s not working without the delay!)

So how do I add a delay to this code:

    $('#insert').submit(function() {
    //Delay here please, or is it timeout I need?
    $('#print').submit();
    });

<form id="insert" action="insert.php" target="hiddeniframe">
// a bunch of inputs
<input type="submit" value="submit">
</form>

<form id="print" action="pdf.php" target="hiddeniframe">
// a bunch of inputs
</form>
  • 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-05T22:05:31+00:00Added an answer on June 5, 2026 at 10:05 pm

    It’s not clear on what your scripts are doing / returning, but you can always use ajax for the first request, then use the iframe for the second request. Eg:

    $('#insert').on('submit', function(e) {
      e.preventDefault();
    
      $.ajax({
        url: $(this).attr('action'),
        type: 'POST',
        data: $(this).serialize(),
        success: function() {
          // duplicate fields from first form into second form
          // as per whatever code you've already written
    
          // submit second form
          $('#print').submit();
        })
      });
    });
    

    This way the second form is submitted after the successful response of the first form.

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

Sidebar

Related Questions

I am trying to have two submit buttons in my form - one accepts
I'm trying to create a simple form with two different submit buttons: one which
I am having two problems. First: Trying to submit this form using jquery. When
I have a page with several forms. I am trying to submit one of
I'm trying to make two forms that aren't displayed at the same time. The
i am trying to submit 2 forms at the same time im trying to
I'm trying to submit a form when a select changes using jQuery Mobile. I
i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I'm trying to submit a few forms through a Python script, I'm using the
I am learning RoR and trying to use accepts_nested_attributes_for and has_and_belongs_to_many to submit information

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.