Multiple submit buttons in a jsp form?
843840Oct 4 2007 — edited Mar 28 2008I've been doing some research and found out that multiple buttons in a JSP form are possible by two ways:
- We can obtain the value of the submit button to know which one was clicked in the parameters of the request using the name of the buttons (which should be the same for all the submit buttons).
- We can change the submit destination using Javascript (Horrible solution since I want my web site to be safe to be used even if Javascript isn't active in clients browsers. I will use it of course since we can do amazing things with it but I want my website to be able to work without it also)
WHAT annoys me is the fact that the value of a submit button is also his text, so if I change the text of the submit button, I will always have to check the servlet to do the corresponding change.
Is there a third choice to be able to use multiple buttons?
Olivier Voutat