which submit button was pressed?

Results 1 to 3 of 3

Thread: which submit button was pressed?

  1. #1
    Sv Guest

    Default which submit button was pressed?

    Hello!<BR>I have 2 submit buttons with name=but1 and name=but2. After their pressing the event POST of form is working. Can I know which submit button was pressed and caused that POST? <BR><BR>Thanks ahead!!!

  2. #2
    Francis B Guest

    Default RE: which submit button was pressed?

    Try having the 2 buttons in the form like this<BR>ie form.asp<BR><BR>&#039 some HTML<BR>&#039..<BR>&#060;FORM NAME=Form1 ACTION=Main.asp? METHOD=post &#062;<BR>&#060;Input Type="SUBMIT" Name="Submit" Value="&#060;%=Con_Button1%&#062;"&#062;<BR>&#060; Input Type="SUBMIT" Name="Submit" Value="&#060;%=Con_Button2%&#062;"&#062;<BR><BR>wh ere Con_Button1,Con_Button2 are constants representing the text on the button ie <BR>Const Con_Button1="send"<BR><BR>When the form is posted you can pickup the button pressed by doing the following<BR><BR>on the page the data was submitted to ie Main.asp<BR>dim btnName<BR>btnName=Request("Submit")<BR><BR><BR><B R>select Case cstr(btnName)<BR><BR>case Con_Button1<BR>&#039do something<BR>case Con_Button2<BR>&#039do something else<BR><BR>case else<BR>end select<BR><BR>using a constants file you can then change the names of the buttons in your form in 1 place and the code will still work<BR><BR>hope this helps<BR><BR>Francis B<BR>

  3. #3
    Sv Guest

    Default Thank you very much!

    Really thanks a lot

Posting Permissions

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