Barbara69
asked on
trying to use request.getParameter in jsp
I have a submit button on a error.jsp page. I'm trying to use the error.jsp for more the one possible error message display pages (have 3 servelts in the project). What I want to do is based on the strPage from a servlet either send to registerNewProjects.jsp if it = RegisterNewProjects or the index.jsp if it doesn't (which it won't coming from the other 2 jsps). This particular possible error message display is based on inputted data from the user. I'm having problems getting the strPage (which is set RegisterNewProjects) to from the servlet.
i'm using the below to call my script
<FORM name="myform" onSubmit="return page();">
<SCRIPT language="JavaScript">
function page()
{
if (request.getParameter("str Page")=="R egisterNew Projects")
{document.myform.action ="registerNewProjects.jsp" ;}
else
{document.myform.action ="index.jsp";}
return;
}
</SCRIPT>
i'm using the below to call my script
<FORM name="myform" onSubmit="return page();">
<SCRIPT language="JavaScript">
function page()
{
if (request.getParameter("str
{document.myform.action ="registerNewProjects.jsp"
else
{document.myform.action ="index.jsp";}
return;
}
</SCRIPT>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<SCRIPT language="JavaScript">
function page()
{
<%
if ("RegisterNewProjects".equ
{
%>
document.myform.action ="/BMAP/jsps/registerNewPr
<%
}
else
{
%>
document.myform.action ="/BMAP/jsps/index.jsp";
<%
}
%>
}
</SCRIPT>