fill out forms on web pages

fill out forms on web pages

I want to fill out forms on web pages, it's is very important to my project. For example there is a web-site www.blauh...com , in which there wil be a form , what i hav to do is to fill that form fields automatically by providing values in my java program.

Please, I need help on this from roseindia(experts), who helped me
in many aspects.. I had tried my level best from last 3 days but i'm not able to get it..

thanks in advance ,, plzzzz send me a simple example if possible.

View Answers

January 4, 2010 at 11:51 AM

Hi Friend,

We have used database to get the form details according to the id that has been entered by the user.

1)id.jsp:

<form method="post" action="form.jsp">
Enter ID:<input type="text" name="ide">
<input type="submit" value="Submit">
</form>

2)form.jsp:

<%@ page import="java.sql.*"%>
<%
String id=request.getParameter("ide");
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/register";, "root", "root");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from contact where id='"+id+"'");
String first="",last="",address="",no="",email="";
while(rs.next()){
first=rs.getString("first_name");
last=rs.getString("last_name");
address=rs.getString("address");
no=rs.getString("phoneNo");
email=rs.getString("email");
}
%>
<table>
<tr><td>First Name:</td><td><input type="text" value="<%=first%>"></td></tr>
<tr><td>Last Name:</td><td><input type="text" value="<%=last%>"></td></tr>
<tr><td>Address:</td><td><input type="text" value="<%=address%>"></td></tr>
<tr><td>Contact No:</td><td><input type="text" value="<%=no%>"></td></tr>
<tr><td>Email:</td><td><input type="text" value="<%=email%>"></td></tr>
</table>

3) database table 'contact':

CREATE TABLE `contact` (
`id` int(11) NOT NULL auto_increment,
`first_name` varchar(255) default NULL,
`last_name` varchar(255) default NULL,
`address` varchar(255) default NULL,
`phoneNo` varchar(255) default NULL,
`email` varchar(255) default NULL,
PRIMARY KEY (`id`)
)

Thanks









Related Tutorials/Questions & Answers:
fill out forms on web pages - JDBC
fill out forms on web pages    I want to fill out forms on web pages, it's is very important to my project. For example there is a web-site www.blauh...com , in which there wil be a form , what i hav to do is to fill that form
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
Advertisements
validating web pages
validating web pages  How to validate HTML web pages
tabs or indents in Web pages
tabs or indents in Web pages  How do you create tabs or indents in Web pages
online voting systems with 10 forms and 3 pages calculations
online voting systems with 10 forms and 3 pages calculations  kindly send me the online voting system and online inventory management systems used by java or html, with 10 forms and 3 validation pages, with form designing
Dynamic web pages
Dynamic web pages  hi, i am just creating a web page using html and javascript. i want to give it a eye catching look using javascript. I just want...; zoom out, image loading from database etc. please guide me & help me, so
we make a picture as a background on my web pages
we make a picture as a background on my web pages  How do we make a picture as a background on my web pages
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
Fill in the blanks.
Fill in the blanks.   Fill in the blanks. 1 ___operator is used to crate an array. 2 ___method can be called without the instance of a class. 3 When an interface method is implemented in a class. it must be declared
how to save web pages in a partcular document in html format using java.. - Java Beginners
how to save web pages in a partcular document in html format using java..  i have to save a particular web page in a folder in html format using java... save the web page in a folder and then will parse the page. the parsing part
use forms.
use forms.  How do I use forms
How to fill double array in java
How to fill double array in java  how to fill double array in java
fill combobox at runtime jsp
fill combobox at runtime jsp  i have 1 combobox in jsp which is filled with value from sql db on load of form <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn
Java Server Pages(JSP)
Java Server Pages(JSP)       JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic web content. It is a server side scripting
random color fill
random color fill   Hi I am trying to create a randomly color filled oval but the outcome is a black filled oval this is the code: package assignment2; import java.awt.Color; import java.awt.Graphics; import java.util.Random
ModuleNotFoundError: No module named 'red-fill'
ModuleNotFoundError: No module named 'red-fill'  Hi, My Python...-fill' How to remove the ModuleNotFoundError: No module named 'red-fill... to install padas library. You can install red-fill python with following
ModuleNotFoundError: No module named 'fill-missing-101703384'
ModuleNotFoundError: No module named 'fill-missing-101703384'  Hi...: No module named 'fill-missing-101703384' How to remove the ModuleNotFoundError: No module named 'fill-missing-101703384' error? Thanks   Hi
ModuleNotFoundError: No module named 'fill-voids'
ModuleNotFoundError: No module named 'fill-voids'  Hi, My Python... 'fill-voids' How to remove the ModuleNotFoundError: No module named 'fill... have to install padas library. You can install fill-voids python
Ajax Pages
Ajax Pages       Ajax Pages is a scripting template engine that enables rapid development of Ajax Web-based Applications, just like GMail, Google Maps, A9 and Backpack, but without having
Auto Fill Textbox - Java Beginners
Auto Fill Textbox   hi i am going to develope a php page with a select box and i want that this select box get auto fill when i write on it. please help me
Traditional Means of Web Application Development
Traditional Means of Web Application Development       In the early days the web pages were static, simple HTML web pages, later on it became dynamic by using CGI script (Perl
JavaServer Pages (JSP) Roseindia
JavaServer Pages (JSP) is used to develop dynamic web content on the server... pages that get compiled into Java servlets the first time they are invoked. JSP... output format is needed.ADS_TO_REPLACE_1 Overview JavaServer Pages allows
jsp pages
jsp pages  I am using 3 jsp pages in an application.. 1.login.jsp 2.checkuser.jsp:is connected to databse..from this page im giving path to search.jsp 3.search.jsp:Here we need fetch data from data base..do u want to connect
JSP WITH MULTIPLE FORMS
on a single page. For example on one web page you may add forms for login, search... JSP WITH MULTIPLE FORMS       In  this example, you will learn how to make multiple forms
HTML pages.
HTML  pages. Description : HTML is a hypertext markup language. Every HTML page has two part one head part another is body. It will  run on browser. Anything available in head will not display on browser. Body part is used
Brief Introduction to the Web Application development
Brief Introduction to the Web Application development Gone are the days of serving static HTML pages to the world. Now a days most website serves the dynamic pages based on the user and their inputs
php create pages automatically
php create pages automatically  How to create pages automatically in PHP
Store data in HTML forms from Excel sheet
Store data in HTML forms from Excel sheet  I have a excel file having multiple coloums, and having one Html page having forms corrospoding to excel coloums. I want to auto fill up the excel data into html forms, Any one please
ModuleNotFoundError: No module named 'fill_broken_words'
ModuleNotFoundError: No module named 'fill_broken_words'  Hi, My... named 'fill_broken_words' How to remove the ModuleNotFoundError: No module named 'fill_broken_words' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'fill_broken_words'
ModuleNotFoundError: No module named 'fill_broken_words'  Hi, My... named 'fill_broken_words' How to remove the ModuleNotFoundError: No module named 'fill_broken_words' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'flood-fill-filter'
ModuleNotFoundError: No module named 'flood-fill-filter'  Hi, My... named 'flood-fill-filter' How to remove the ModuleNotFoundError: No module named 'flood-fill-filter' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'fill-missing-values-ashwin'
ModuleNotFoundError: No module named 'fill-missing-values-ashwin'  Hi...: No module named 'fill-missing-values-ashwin' How to remove the ModuleNotFoundError: No module named 'fill-missing-values-ashwin' error? Thanks
Iterating through pages
Iterating through pages  hello, I have a web page with a table...". And the next 100 records will get displayed in the page2. The pages go on wrt... with a sample java/ jsp code or technical details of how to iterate through the pages
Tutorials - Java Server Pages Technology
independent, in its dynamic web pages, its web servers, and its...-enabled application server. The JSP pages can be accessed from any web... Tutorials - Java Server Pages Technology   
static page and dynamic pages?
static page and dynamic pages?  what is the diff between static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages
static page and dynamic pages?
static page and dynamic pages?  what is the static page and dynamic pages adv and disadv
ModuleNotFoundError: No module named 'pages'
ModuleNotFoundError: No module named 'pages'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pages' How to remove the ModuleNotFoundError: No module named 'pages'
Multiple forms in JSP - JSP-Servlet
Multiple forms in JSP   Hi, I want to place multiple submit buttons in jsp pages ! and the multiple buttons will perform multiple actions based on the click of those buttons !   function
log out
log out  how do i create a log out on a project without it exiting system so it does not reload again
Is there anyone out there?
Is there anyone out there?  Hi please could somebody respond as I am seeking advice but not getting any and do not know whether or not to continue using this site
textfield should not allow the user to fill the date in it.
textfield should not allow the user to fill the date in it.  I got.... Here user should not fill the date inside the text field manually. If he tries to fill the date manually, i have to display some message like "please click
Version of swt>forms dependency
List of Version of swt>forms dependency
Version of jgoodies>forms dependency
List of Version of jgoodies>forms dependency
Version of com.jgoodies>forms dependency
List of Version of com.jgoodies>forms dependency
Version of com.tuyenmonkey>auto-fill-edit-text dependency
List of Version of com.tuyenmonkey>auto-fill-edit-text dependency
Introduction to the JSP Java Server Pages
how to track the session between different JSP pages. In any web application... source code. Introduction to JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent
How to chage content in HTML pages?
How to chage content in HTML pages?  Hi I am creating a web app... make it so that change in one page can affect all of the pages? Ex. In menu I havn't added "about us" and then after developing all the static pages if I want
Web Server
Web Server       A web... or intranet and interacts with the client through a web browser and delivers the web pages to the client. Apache and Microsoft's Internet Information Server (IIS
use tables to structure forms
use tables to structure forms  How can I use tables to structure forms

Ads