In my App there is an html file with two textfield(num1,num2)and two button named add and substract.
after entering two numbers in the textfield and clicking any button of the two button then the app should display the desired result (num1+num2) or (num1-num2) for that I have created a servlet(first time I have created the app with only one button (add)then it works fine).
But my problem is how the servlet know which button is clicked
my previous servlet code is:-
What are the changes need in the App to work ,Please clarify my doubt... [ November 11, 2008: Message edited by: Ashok Pradhan ]
Because the browser does not send anything for a button that is not clicked.
If you have two buttons, add and subtract, and the user clicks on the add button, its name and value will be sent to the server in the post string. Nothing will be sent up for the subtract button so request.getParameter("subtract") will return null. [ November 11, 2008: Message edited by: Ben Souther ]