Too complex:
The only thing I should know is:
The submit button's NAME (and value) will only be sent if that particular button was used to submit the form, so you should be able to check that in the server side script.
Rest is history:
Hello to everybody. I'm new in everything and I need your help.
How can I checked what submit button was pressed?
I have something like this:
form
input - I collect info
submit button1 GOTO to page1.jsp for processing the info using formula 1
submit button2 GOTO to page1.jsp for processing the info using formula 2
I tried something like this:
Expand|Select|Wrap|Line Numbers
- <HTML>
- <HEAD>
- <TITLE>Using Buttons</TITLE>
- </HEAD>
- <BODY>
- <%
- String s = request.getParameter("buttonName") ***********************************************************
- %>
- <FORM NAME="form1" METHOD="POST">
- <INPUT TYPE="HIDDEN" NAME="buttonName">
- <INPUT TYPE="BUTTON" VALUE="Button 1" ONCLICK="button1()">
- <INPUT TYPE="BUTTON" VALUE="Button 2" ONCLICK="button2()">
- </FORM>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- function button1()
- {
- document.form1.buttonName.value = "button 1"
- form1.submit()
- }
- function button2()
- {
- document.form1.buttonName.value = "button 2"
- form1.submit()
- }
- // -->
- </SCRIPT>
- </BODY>
- </HTML>
So.. Can you help me?:)