Print content on same page??

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:&nbsp;&nbsp;&nbsp;
<select name="sel1" id="sel1" onchange="createSecondMenu('sel1','sel2');">
</select>
&nbsp;&nbsp;&nbsp;&nbsp;Criterion&nbsp;&nbsp;
<select name="sel2" id="sel2">
<option value="">-- Choose --</option>
</select>
&nbsp;Searchword:&nbsp;
<input name="search" type="text" id="search">
&nbsp;
<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,786
Messages
2,569,625
Members
45,321
Latest member
AlphonsoPi

Latest Threads

Top