我想知道我们如何在jsp中有不同的按钮,以及如何为我们按下的按钮提交相应的页面。
我试过休闲代码:
<html>
<head> </head>
<body>
<%-- scriptlet here --%>
<%
if(request.getParameter("btnSubmit_1")!=null)
{
// means submit_1 is pressed.
// in java script we do give action as fallows
/**document.frm2.action="sub-faconline.jsp";
//document.frm2.target="right_f";
//document.frm2.submit();****
my question how can we do above java script code in scriplet in jsp
}
else if(request.getParameter("btnSubmit_2")!=null)
{
// i want to give some jsp page name here for action.
}
%>
<form name="frm2" method="post">
<input type="button" id="btnSubmit_1" name="btnSubmit_1" value="btnSubmit_1" />
<input type="button" id="btnSubmit_2" name="btnSubmit_2" value="btnSubmit_2"/>
</form>
</body>
</html>