I have form with two buttons having same name but different values ,how to get the value of both the buttons having same name but different value using request ?
<form action="controller">
<input class="smallbutton" name="op" value="login" type="submit"/>
<input class="smallbutton" name="op" value="SignUp" type="submit"/>
</form>
request.getParameter("op") gives only the value of login but not sign up.
I can’t imagine why would you need such a thing. Two options, depending on what you are trying to acheive:
request.getParameterValues("op")<input type="hidden" value=".." />and change the value using javascript according to your usecase.Please clarify what’s the bottom-line, i.e. what are you trying to do.