html input passing to jsp method
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>
View Answers
October 17, 2011 at 10:39 AM
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.............
October 17, 2011 at 6:10 PM
how can i get the value without using request.getParameter();
October 18, 2011 at 6:37 PM
you can also do as
get the value in javascript, set those values in session using javascript
October 18, 2011 at 7:32 PM
thank you very much..it solved my problem
Ads
Related Tutorials/Questions & Answers:
html input passing to jsp method
html input passing to
jsp method i want code in which
jsp method takes
html input value which is in same page......
<html>
<head>...;
input type="text" name=pid onblur="m1()" />
<
input type="text" name
passing data between the jsp pages ?
passing data between the
jsp pages ? i developed a project on student marks system.in this project their is one
html page which asks user to enter the roll number and when we press submit button on that page it moves a
jsp page
Advertisements
html-jsp
html-jsp If i want to get dynamic value in
html textbox or in
jsp,then how can I get the value,how the value will be transfered from servlet page to the
html textbox.Thanx in advance.....Kindly help me
Passing parameters in JSP using forward.
Passing parameters in
JSP using forward. If a page is forwarded to another page using
jsp:forward, is it necessary that the page should be already............
Pass Parameters using
jsp:forward
Input / Output in Easiest Method in Java
Input / Output in Easiest
Method in Java How to
input from keyboard... with the easiest
method in Java?
Hi Friend,
Try the following code:
import...)throws Exception{
Scanner
input=new Scanner(System.in
JSP parameter passing throught out web app
JSP parameter
passing throught out web app i want to pass one param from page1.jsp page to page4.jsp page but in between this i need to navigate page3.jsp and page2.jsp.Please help me to understand how could i transfer param
Post Method of the Form In JSP
Post
Method of the Form In
JSP
 ... of the post
method of the form in
JSP. The HTTP post
method sends data to the server
from the
HTML form elements. This
method does not show the value of elements
convert this html form to jsp
convert this
html form to jsp <html>
<head>
<script...;/tr>
<form name="VillageDetailsForm" action="AddVillage.jsp"
method...;/td>
<td style="padding-top: 10px;" valign="top">
<
input class
how to use sendRedirect in doGet method in jsp?
how to use sendRedirect in doGet
method in
jsp? i am getting problem in
jsp that when we are directly writing address to a
jsp page in addressbar the
jsp page should redirect it to the
html page.
can any one tell me
Passing Parameters in jsp
Passing Parameters in
jsp
This section illustrates you how to pass parameters in
jsp.
JSP can... file. We are
passing the parameters using the tag <
jsp:param> which contain
Get Method of the Form In JSP
Get
Method of the Form In
JSP
 ... of the form in
JSP. The HTTP get
method sends data to the server.
In your
JSP...;
<head><title>Using Get
Method in
JSP Form.</title></head>
how to write a jsp form using html
how to write a
jsp form using html hi,
i have written the code as below... but it is showing error. please help me how to resolve it.
.
html file...;
<body>
<form
method="POST" action="Form1.jsp">
EmployeeNo:
<
How to work with POST method in jsp page
How to work with POST
method in
jsp page... POST
method
instead of GET
method in
jsp page. GET is default
method for sending... hidden!
jsp_with_post_method.jsp: Using POST
method is
nothing different
HTML tags in JSP
HTML tags in
JSP
 ... the
html
tag inside the
JSP code.
In this example we have used the
html tag inside the println()
method of the out implicit object which is used
Passing Parameters using <jsp: param>
Passing Parameters using <
jsp: param>
 ... from one
jsp file to another file. The targeted file can be a
Html file,
jsp file...;
In this example we are
passing a parameters to a file
by using <
jsp
Html+jsp+database is enough to do the small operation
Html+
jsp+database is enough to do the small operation Hai ,
If u... not to bother about whole code.just u consentration on
html,ajax,
jsp,any db.here i am using db2.
Html for insertion:
<form name="StudentForm"
method="post
HTML get Method
HTML get
Method
The
HTML get
Method is used to submit the data of the page...
The Tutorial helps you to understand an example from
HTML get
Method
Passing Parameters to Another JSP Page
Passing Parameters to Another
JSP Page
By using the include action we can pass the parameters
to another
jsp page... in the
jsp post from the
html form or the
jsp page.
The code
how to insert data in database using html+jsp
;form action="index.jsp"
method="get">
<
input style="width: 850px...
method="post" action="http://localhost:8080/examples/
jsp/insert.jsp">
<...how to insert data in database using
html+jsp anyone know what
JSP to add details to a database from a HTML form.
JSP to add details to a database from a
HTML form. Hi
I'm a second year CS student who has to use
JSP to validate a
HTML form and add the details.....
Can anyone tell me what is wrong with my code?
html code first
Passing variable
Passing variable How to pass variable to HTTP object in
HTMl or PHP