
i want code in which jsp method takes html input value which is in same page......
<html>
<head>
<%!public void method1()
{
**???how to read pid value here???**
}%>
</head>
<body>
<table>
<tr>
<td>Product ID</td>
<td>Product Name</td>
<td>Cost</td>
<td>Quantity</td>
</tr>
</table>
<form>
<input type="text" name=pid onblur="m1()" />
<input type="text" name=pname />
<input type="text" name=pcost />
<input type="text" name=pcost />
<input type="text" name=qty />
</form>
</body>
</html>

Hi please Find the Following code
<%
if (request.getMethod() == "POST") {
out.println(request.getParameter("userId"));
out.println(request.getParameter("password"));
}
%>
<html>
<head>
<title>Input JSp</title>
</head>
<body>
<h2 align="center">Login Here</h2>
<center>
<form name="myForm" method="post">
<table>
<tr>
<td>User Id</td>
<td><input type="text" name="userId" id="userId" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="password" name="password" /></td>
</tr>
<tr>
<td align="right" colspan="2"><input type="submit" value="login" /></td>
</tr>
</table>
</form>
</center>
</body>
</html>
You can Specify the action also in the form.............

how can i get the value without using request.getParameter();

you can also do as
get the value in javascript, set those values in session using javascript

thank you very much..it solved my problem
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.