Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC fill out forms on web pages
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


dileep
fill out forms on web pages
1 Answer(s)      5 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.


Advertisement
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
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
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
tabs or indents in Web pages
tabs or indents in Web pages  How do you create tabs or indents in Web pages
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
use forms.
use forms.  How do I use forms
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
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
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
How to fill double array in java
How to fill double array in java  how to fill double array in java
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
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
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
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
Two forms and One Servlet
Two forms and One Servlet  Dear Sir, I have 2 forms in one page and one submit button into second form which submits data to one servlet. If I do... get both forms textbox value. Thanks in advance
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
JAVA BEAN WITH ORACLE FORMS
JAVA BEAN WITH ORACLE FORMS  Hi..I am doing my final year Project.. I need the ste-by-step procedure to integrate a bean with oracle forms? Please help me
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
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
inteconnecting forms - JSP-Servlet
inteconnecting forms  hi, i have several tables in mysql database. i am creating some forms using jsp. i want to enter the name of the table and to get the table specified in the entry box to be displayed in the output
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
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
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
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
Advertisements
 

 

 

DMCA.com