Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

fill out forms on web pages

Ads

 
 

Share on Google+Share on Google+

dileep
fill out forms on web pages
1 Answer(s)      7 years ago
Posted in : JDBC
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.

Ads
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

Ads









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
validating web pages
validating web pages  How to validate HTML web pages
Advertisements
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
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
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
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
How to fill double array in java
How to fill double array in java  how to fill double array in java
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
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
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
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. Overview JavaServer Pages allows developer to build
What are different normalization forms?
What are different normalization forms?  What are different normalization forms?   Hi, 1NF: Eliminate Repeating Groups- Make a separate... attributes, separate them out into distinct tables. 4NF: Isolate Independent
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
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
use tables to structure forms
use tables to structure forms  How can I use tables to structure forms
use tables to structure forms
use tables to structure forms  How can I use tables to structure forms
tables to structure forms
tables to structure forms  How can I use tables to structure forms
tables to structure forms
tables to structure forms  How can I use tables to structure forms
Web Performance Analyzer
takes the guesswork out of web page development! This new development tool enables... of your web pages. They'll never get faster than this.   Capture web pages as you browse, and revealing dynamic HTTP requests, forwards
Tutorials - Java Server Pages Technology
The JavaServer Pages 1.2 specification provides web.... The JSP technology is platform independent, in its dynamic web pages, its web servers, and its underlying server components. That is, JSP pages
Version of jgoodies>forms dependency
List of Version of jgoodies>forms dependency