Click to See Complete Forum and Search --> : onClick handling in JSP...


ink777
September 9th, 2003, 08:46 AM
Hi,
I have a jsp page where I display 2 buttons, 'Add' and 'Delete'. I need to check which of these two buttons is clicked and call a different jsp for each. How do I do that?
The outline is something like this....

<input type="button" value="Add" onclick="<jsp:forward page = "some.jsp"/>">
else
<jsp:forward page = "someother.jsp"/>

ZoSoo7
September 12th, 2003, 02:16 PM
You don't need to use any server side scripting, so just use javascript or vbscript:

<input type=button name=add
onClick="vbscript:location.href 'addurl.jsp' ">
<input type=button name=delete
onClick="vbscript:location.href 'delurl.jsp' ">