submit form to multiple pages

Discussion in 'ASP General' started by Slug, Oct 12, 2004.

  1. Slug

    Slug Guest

    Hello,
    I've tried to find this answer, but can't seem to get a clear example -

    I'm using the following classic asp code to submit a form:
    <form action="default.asp" name=order method=post>

    What I need to do is to submit the form to multiple .asp pages, (that I
    want to join with frames) and I can't find a way to do it.

    Thanks.
     
    Slug, Oct 12, 2004
    #1
    1. Advertising

  2. Slug

    Just1Coder Guest

    Slug wrote:
    > Hello,
    > I've tried to find this answer, but can't seem to get a clear example -
    >
    > I'm using the following classic asp code to submit a form:
    > <form action="default.asp" name=order method=post>
    >
    > What I need to do is to submit the form to multiple .asp pages, (that I
    > want to join with frames) and I can't find a way to do it.
    >
    > Thanks.
    >

    Not very efficient, but you could carry the form variables over after
    the first post to a second, third.. etc...

    top of defalut.asp
    dim frmval1, frmval2
    frmval1 = request.form("frmval1")
    frmval2 = request.form("frmval2")

    process the form here...

    ... at the end of default.asp..

    if err.number <> and all other business rules = true then
    response.redirect("action2.asp?frmval1=frmval1&fmrval2=frmval2")
    end if
     
    Just1Coder, Oct 12, 2004
    #2
    1. Advertising

  3. Slug

    John Guest

    Use Javascript.

    <html>

    <head>
    <script type="text/javascript">
    function formSubmit()
    {
    document.forms.myForm.action="action1.asp"
    document.forms.myForm.submit()
    document.forms.myForm.action="action2.asp"
    document.forms.myForm.submit()
    }
    </script>
    </head>

    <body>
    <form name="myForm" method="get">
    Firstname: <input type="text" name="firstname" size="20"><br />
    Lastname: <input type="text" name="lastname" size="20"><br /><br />
    <input type="button" onclick="formSubmit()" value="Submit">
    </form>
    </body>

    </html>


    "Slug" <> schreef in bericht
    news:...
    > Hello,
    > I've tried to find this answer, but can't seem to get a clear example -
    >
    > I'm using the following classic asp code to submit a form:
    > <form action="default.asp" name=order method=post>
    >
    > What I need to do is to submit the form to multiple .asp pages, (that I
    > want to join with frames) and I can't find a way to do it.
    >
    > Thanks.
    >
     
    John, Oct 12, 2004
    #3
  4. Did you try this? The second submit won't happen, because control will
    already have been handed over to action1.asp.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)






    "John" <n o b o d > wrote in message
    news:XbWad.276903$-ops.be...
    >
    > Use Javascript.
    >
    > <html>
    >
    > <head>
    > <script type="text/javascript">
    > function formSubmit()
    > {
    > document.forms.myForm.action="action1.asp"
    > document.forms.myForm.submit()
    > document.forms.myForm.action="action2.asp"
    > document.forms.myForm.submit()
    > }
    > </script>
    > </head>
    >
    > <body>
    > <form name="myForm" method="get">
    > Firstname: <input type="text" name="firstname" size="20"><br />
    > Lastname: <input type="text" name="lastname" size="20"><br /><br />
    > <input type="button" onclick="formSubmit()" value="Submit">
    > </form>
    > </body>
    >
    > </html>
    >
    >
    > "Slug" <> schreef in bericht
    > news:...
    > > Hello,
    > > I've tried to find this answer, but can't seem to get a clear example -
    > >
    > > I'm using the following classic asp code to submit a form:
    > > <form action="default.asp" name=order method=post>
    > >
    > > What I need to do is to submit the form to multiple .asp pages, (that I
    > > want to join with frames) and I can't find a way to do it.
    > >
    > > Thanks.
    > >

    >
    >
     
    Aaron [SQL Server MVP], Oct 12, 2004
    #4
  5. You can do one of three things:

    - submit to form1, then use hidden form variables to submit to form2 (maybe
    using a hidden frame)
    - post the value of request.form to form2 using MSXML
    (http://www.aspfaq.com/2173)
    - combine the functionality of both forms so that you only need to submit to
    one page

    I strongly recommend against using frames. They mess with the browser's
    bookmarks and history, and very rarely provide functionality that a
    non-framed page provides. Besides, they won't help you solve this issue.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Slug" <> wrote in message
    news:...
    > Hello,
    > I've tried to find this answer, but can't seem to get a clear example -
    >
    > I'm using the following classic asp code to submit a form:
    > <form action="default.asp" name=order method=post>
    >
    > What I need to do is to submit the form to multiple .asp pages, (that I
    > want to join with frames) and I can't find a way to do it.
    >
    > Thanks.
    >
     
    Aaron [SQL Server MVP], Oct 12, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    722
  2. Replies:
    4
    Views:
    1,014
  3. Matt
    Replies:
    2
    Views:
    193
    Bob Barrows [MVP]
    Jun 27, 2004
  4. Matt
    Replies:
    1
    Views:
    228
    Thomas 'PointedEars' Lahn
    Jul 5, 2004
  5. Replies:
    3
    Views:
    796
Loading...

Share This Page