Two Submits?

Discussion in 'ASP General' started by James Baker, Jun 10, 2004.

  1. James Baker

    James Baker Guest

    Once again, trying to re-learn ASP with all of my might. Probably a simple
    problem, but here goes:

    I have a form that current has a fair amount of data/input tags and a button
    that submits it to another page for processing. I'm building another button
    on this same page that will post to an entirely different page, but needs a
    lot of the same data as the original button. I assume I can't have both
    submit buttons within the same form, yet I need access to the same data.
    I'm probably missing something pretty obvious, but I can't figure this out
    for the life of me.

    TIA,
    James
     
    James Baker, Jun 10, 2004
    #1
    1. Advertising

  2. James Baker

    Patrice Guest

    You can change the "action" attribute of the form tag to change the page to
    which you submit those data. All dates within the form tag will be submitted
    (you can just ignore those you don't want).
    Looks a bit weird (don't you loose some changes if you clicked on the
    "wrong" button ?)

    My personal preference is to submit to the same page. You can test which
    button was clicked (you'll get the value of the pressed button server side
    so that you can perform the appropriate action.

    Patrice

    "James Baker" <> a écrit dans le message de
    news:...
    > Once again, trying to re-learn ASP with all of my might. Probably a

    simple
    > problem, but here goes:
    >
    > I have a form that current has a fair amount of data/input tags and a

    button
    > that submits it to another page for processing. I'm building another

    button
    > on this same page that will post to an entirely different page, but needs

    a
    > lot of the same data as the original button. I assume I can't have both
    > submit buttons within the same form, yet I need access to the same data.
    > I'm probably missing something pretty obvious, but I can't figure this out
    > for the life of me.
    >
    > TIA,
    > James
    >
    >
     
    Patrice, Jun 10, 2004
    #2
    1. Advertising

  3. Why does it have to be a submit button?

    <input type=button onclick='...do some javascript stuff and submit the
    form...'>

    Not really an ASP question, you should find techniques for changing the
    form's action parameter (depending on the button clicked) in a client-side
    group, like microsoft.public.scripting.jscript

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




    "James Baker" <> wrote in message
    news:...
    > Once again, trying to re-learn ASP with all of my might. Probably a

    simple
    > problem, but here goes:
    >
    > I have a form that current has a fair amount of data/input tags and a

    button
    > that submits it to another page for processing. I'm building another

    button
    > on this same page that will post to an entirely different page, but needs

    a
    > lot of the same data as the original button. I assume I can't have both
    > submit buttons within the same form, yet I need access to the same data.
    > I'm probably missing something pretty obvious, but I can't figure this out
    > for the life of me.
    >
    > TIA,
    > James
    >
    >
     
    Aaron [SQL Server MVP], Jun 10, 2004
    #3
    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. Robert V
    Replies:
    1
    Views:
    1,183
    Jeremy Fluhmann
    Jul 21, 2003
  2. Scott M.

    Run JavaScript before Form Submits

    Scott M., Nov 17, 2003, in forum: ASP .Net
    Replies:
    14
    Views:
    7,103
    Joe Gass
    Nov 18, 2003
  3. Stan
    Replies:
    1
    Views:
    2,531
    Jacob Yang [MSFT]
    Dec 3, 2003
  4. Mad Scientist Jr
    Replies:
    1
    Views:
    540
    bruce barker
    Mar 5, 2004
  5. Wysiwyg
    Replies:
    2
    Views:
    1,758
    Wysiwyg
    Apr 26, 2005
Loading...

Share This Page