dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: how to submit Multiple forms

  1. #1
    Join Date
    Mar 2006
    Posts
    66

    how to submit Multiple forms

    Hello,
    How can one submit multiple forms at a time. At the same time the values must get Forwarded another page.
    Please help me out of this a.s.ap.

  2. #2
    Join Date
    Nov 2005
    Posts
    3
    Only a single form can be submitted from a web page. There are a number of ways to deal with this including popup the submit response (ugly) or use AJAX to 'Post' the form data, I suggest you consider ways to get your multi-form in a single entity. HTH

    Kal.

  3. #3
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    700
    Actually, it is possible to submit multiple forms, as long as the target for each form is different.

    Like this...

    <form id='form1' name='form1' action='firsttarget.htm' target='_blank' method='POST'>
    --your form fields--
    </form>
    <form id='form2' name='form2' action='secondtarget.htm' target='_self' method='POST'>
    --your form fields--
    </form>

    Then, rather than a submit button, a link like this...
    <a href='javascript:doit()'>Click Here To Submit Both Forms</a>

    And in the header...
    <script language='javascript'>
    <!--
    function doit()
    {
    document.form1.submit();
    document.form2.submit();
    }
    -->
    </script>

    When you click, it will submit the first form to a page that opens in a new window, and the second form to a page that opens in the current window.

    Or you could use iframes...
    <iframe name='if1' id='if1' src='firsttarget.htm' border='0' frameborder='0' scrolling='auto' width='240' height='680'></iframe>
    <iframe name='if2' id='if2' src='secondtarget.htm' border='0' frameborder='0' scrolling='auto' width='240' height='680'></iframe>

    And in the forms, target='if1' and target='if2' respectively.

    In this case, when you click the submit link, it will send the data from the two different forms to the two iframe areas on your page.

    The only caution is that your field names in both forms must be unique... that is, you can't have name='firstname' in the first form, and name='firstname' in the second form too.

    I hope this helps.

    CTB
    Last edited by chestertb; 03-29-2006 at 02:33 AM.

  4. #4
    Join Date
    Mar 2011
    Posts
    3
    Long shot, but here it goes.

    I'm using the script and it works great!

    What needs to happen now is I need to make sure fields in one of the forms are filled out. I've found javascript validation scripts but they rely upon "onSubmit" at the end of the form, which this script does not use.

    Help?

  5. #5

    Smile can I stop pop up screen ?

    Thank you so much for these great information its really work for me. Please can I stop pop up screen ?

  6. #6
    Join Date
    May 2012
    Posts
    1

    Smile How get parallel quotes in one window?

    Quote Originally Posted by wasim_@_drushti View Post
    Hello,
    How can one submit multiple forms at a time. At the same time the values must get Forwarded another page.
    Please help me out of this a.s.ap.
    I have a similar problem:
    I want to search in one run but giving a window with 3 tabs/targets:
    { {john, mary}, {john, sue}, {john, girl} }
    and a minute later
    { {pete, mary}, {pete, sue}, {pete, girl} }
    and continue with different boy names but the same girl names.

    The request page may differ or remain constant.
    The result pages with their 1boy&3girl specs/targets/tabs should differ.

    TIA for any effort you take!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles