From w/ Mulpiple outputs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wg

    From w/ Mulpiple outputs

    I am new to programming in ASP so please forgive me if this seems trivial. I
    am editing a page someone else created. The page loads a list from a
    database, based on the selections (by clicking on the an item in the list it
    gets highlighted) the user has the option of pressing a button to reload the
    page with just what they have chosen all same page but calls others for
    queries and such. This page contains a <form> then has the button to reload
    with the selected events then </form>.

    I am trying to add the function to output the selected events to Excel,
    which I have been able to do by changing the page. The problem is we would
    like two buttons, one to output to a web page, the other to a Excel. Is
    possible to have two submit buttons in a form, one for web output and the
    other for Excel?

    Thanks

    wg


  • William Tasso

    #2
    Re: From w/ Mulpiple outputs

    wg wrote:[color=blue]
    > ...Is possible to have two submit buttons in a form[/color]

    yes - make sure each button has a diferent 'value' so your server-side
    script knows which was clicked.

    --
    William Tasso - http://WilliamTasso.com


    Comment

    • Wade Greene

      #3
      Re: From w/ Mulpiple outputs

      Could you please explain a little more, how do I structure it with the Form
      tag?

      Thanks
      "William Tasso" <ngx@tbdata.com > wrote in message
      news:#0xz2rwYDH A.2328@TK2MSFTN GP12.phx.gbl...[color=blue]
      > wg wrote:[color=green]
      > > ...Is possible to have two submit buttons in a form[/color]
      >
      > yes - make sure each button has a diferent 'value' so your server-side
      > script knows which was clicked.
      >
      > --
      > William Tasso - http://WilliamTasso.com
      >
      >[/color]


      Comment

      • Alan

        #4
        Re: From w/ Mulpiple outputs

        In your form:

        <form name="..." method="..." action="...">
        ....

        <input type="Submit" name="cmdSubmit 1" Value="Button 1 Text">
        <input type="Submit" name="cmdSubmit 2" Value="Button 2 Text">
        </form>

        In your processor:

        If (Request.Form(" cmdSubmit1") <> "") Then

        ' The button labelled 'Button 1 Text' was clicked.

        ElseIf (Request.Form(" cmdSubmit2") <> "") Then

        ' The button labelled 'Button 2 Text' was clicked.

        End If

        Try that.

        Alan

        "Wade Greene" <wg@noway.com > wrote in message
        news:vjr22d63qr 721c@corp.super news.com...[color=blue]
        > Could you please explain a little more, how do I structure it with the[/color]
        Form[color=blue]
        > tag?
        >
        > Thanks
        > "William Tasso" <ngx@tbdata.com > wrote in message
        > news:#0xz2rwYDH A.2328@TK2MSFTN GP12.phx.gbl...[color=green]
        > > wg wrote:[color=darkred]
        > > > ...Is possible to have two submit buttons in a form[/color]
        > >
        > > yes - make sure each button has a diferent 'value' so your server-side
        > > script knows which was clicked.
        > >
        > > --
        > > William Tasso - http://WilliamTasso.com
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...