View Full Version : ONE FORM-- 2 buttons and 2 Actions???

10-08-2002, 09:25 PM
Hi All..
I have a form with lot of fields and 2 buttons

One is a SUBMIT button and this follows the ACTION.Meaning when i click on SUBMIT it goes to servlet defined in the ACTION=

Now My requirement is that the SEARCH button which is besides the 1st Field on my Form. has a different servlet/different functionality other than the SUBMIT.

How do i define two seperate ACTIONS..on two seperate buttons on my form.

I have seen a submit and search in many forms .How do we do it.


10-09-2002, 10:20 AM
<input type="submit" name="btnSubmit" value="Submit" onclick="this.form.action='submitActionServlet'">

<input type="submit" name="btnSearch" value="Search" onclick="this.form.action='searchActionServlet'">