J
JS
I have two forms, a textfield and a button in a jsp page, "search.jsp".
When I press the button the information in the forms and the textfields
should be send to a class that I include in a package in the JSP pages.
The result of the request should be printed on the same page. How do I make
this happen?
<body onload="createFirstMenu('sel1')">
<form name="sels" method="post" action="?page=search">
Category:
<select name="sel1" id="sel1" onchange="createSecondMenu('sel1','sel2');">
</select>
Criterion
<select name="sel2" id="sel2">
<option value="">-- Choose --</option>
</select>
Searchword:
<input name="search" type="text" id="search">
<input type="submit" name="Submit" value="Search">
</form>
<%
int category = Integer.parseInt((String)request.getParameter("sel1")) + 1;
%>
The above java code is not allowed. I have tried to make "action" point to
the same page, but I can't seem to understand how I get the results printed.
When I press the button the information in the forms and the textfields
should be send to a class that I include in a package in the JSP pages.
The result of the request should be printed on the same page. How do I make
this happen?
<body onload="createFirstMenu('sel1')">
<form name="sels" method="post" action="?page=search">
Category:
<select name="sel1" id="sel1" onchange="createSecondMenu('sel1','sel2');">
</select>
Criterion
<select name="sel2" id="sel2">
<option value="">-- Choose --</option>
</select>
Searchword:
<input name="search" type="text" id="search">
<input type="submit" name="Submit" value="Search">
</form>
<%
int category = Integer.parseInt((String)request.getParameter("sel1")) + 1;
%>
The above java code is not allowed. I have tried to make "action" point to
the same page, but I can't seem to understand how I get the results printed.