Form Post Action options

Discussion in 'ASP General' started by SMXSteve, Nov 7, 2005.

  1. SMXSteve

    SMXSteve Guest

    I have a form with several submit buttons. Each one is different. For
    instance, one may require the next action window to be a pop up requesting
    more data. Another may require it to be normal. And of course I need the
    request data from the form.

    I tried not specifying the action on the form and put it on the the submit
    button via the OnClick but the request data was always behind and isn't
    current until after the submit.

    I guess an easy way to think about it is say you have a tool bar and
    depending on which button you click it fires a different asp file but the
    current form data.

    Hope this makes sense.

    Thanks
     
    SMXSteve, Nov 7, 2005
    #1
    1. Advertising

  2. SMXSteve

    SMXSteve Guest

    As things go I found a solution.
    Call a script that actually sets the action to the specific file.

    Something like

    document.myformname.action="page.asp"




    "SMXSteve" wrote:

    > I have a form with several submit buttons. Each one is different. For
    > instance, one may require the next action window to be a pop up requesting
    > more data. Another may require it to be normal. And of course I need the
    > request data from the form.
    >
    > I tried not specifying the action on the form and put it on the the submit
    > button via the OnClick but the request data was always behind and isn't
    > current until after the submit.
    >
    > I guess an easy way to think about it is say you have a tool bar and
    > depending on which button you click it fires a different asp file but the
    > current form data.
    >
    > Hope this makes sense.
    >
    > Thanks
     
    SMXSteve, Nov 7, 2005
    #2
    1. Advertising

  3. You can name all the submit buttons the same and then see which one was
    clicked. Just make sure you handle users who press enter or Ctrl+M to
    submit the form.

    <input type="submit" name="cmdSubmit" value="Action 1">
    <input type="submit" name="cmdSubmit" value="Action 2">
    <input type="submit" name="cmdSubmit" value="Action 3">

    <%

    Select Case Request.Form("cmdSubmit")
    Case "Action 1" ''' do stuff
    Case "Action 2" ''' do stuff
    Case "Action 3" ''' do stuff
    Case Else ''do other stuff
    End Select
    %>

    Ray at work

    "SMXSteve" <> wrote in message
    news:...
    >I have a form with several submit buttons. Each one is different. For
    > instance, one may require the next action window to be a pop up requesting
    > more data. Another may require it to be normal. And of course I need the
    > request data from the form.
    >
    > I tried not specifying the action on the form and put it on the the submit
    > button via the OnClick but the request data was always behind and isn't
    > current until after the submit.
    >
    > I guess an easy way to think about it is say you have a tool bar and
    > depending on which button you click it fires a different asp file but the
    > current form data.
    >
    > Hope this makes sense.
    >
    > Thanks
     
    Ray Costanzo [MVP], Nov 7, 2005
    #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. Joeyej
    Replies:
    0
    Views:
    8,060
    Joeyej
    Jun 4, 2004
  2. Joe Bloggs
    Replies:
    1
    Views:
    839
    Sudsy
    Aug 3, 2003
  3. Brad

    form post action

    Brad, Dec 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    359
  4. John
    Replies:
    0
    Views:
    917
  5. Bosconian
    Replies:
    4
    Views:
    412
    Bosconian
    Dec 3, 2006
Loading...

Share This Page