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



Home Answers Viewqa Java-Beginners to create registration form
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


saranya.m
to create registration form
1 Answer(s)      2 years ago
Posted in : Java Beginners


hello friends,im student and i want to do an assignment on to create an registration form with 20 input fields by using html and after those input fields by using jsp after that insert those input fields into database by using jdbc .i know this is an simple task for u but im just beginner for this language


Advertisement
View Answers

September 4, 2012 at 6:00 PM


Here is a jsp code that accepts several fields from the user and add these values to database.

1)register.jsp:

<html>
<form method="post" action="insert.jsp">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td>Confirm Password:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>Date Of Birth</td><td><input type="text" name="dob"></td></tr>
<tr><td>Age:</td><td><input type="text" name="age"></td></tr>
<tr><td>Gender</td><td><input type="text" name="gender"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td>State:</td><td><input type="text" name="state"></td></tr>
<tr><td>City</td><td><input type="text" name="city"></td></tr>
<tr><td>Telephone No:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*,java.util.*"%>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));
        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }
        %>

For more information, visit the following links:

http://www.roseindia.net/jsp/javascriptpagerefresh.shtml

http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml



Related Tutorials/Questions & Answers:
to create registration form
to create registration form  hello friends,im student and i want to do an assignment on to create an registration form with 20 input fields by using...://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml
how to create a user registration form in php
how to create a user registration form in php  how to create a user registration form in php
Advertisements
to creating a registration form
to creating a registration form  how to create a registration form
How to Create Login/ Registration Form using PHP and MYSQL
How to Create Login/ Registration Form using PHP and MYSQL  Hi, I am learning PHP. I have some dilemma how to create a Login Form and make connectivity with HTML page using PHP and MYSQL. Is there any body can guide me
Registration Form
Registration Form  Hi Friends I am Working on a small project.I have to create a Registration page using MVC pattern where i have to insert data username,password,date of birth,Mobile number number into database. How to insert
How to Create Student Registration Form with HTML Code?
How to Create Student Registration Form with HTML Code? At present, the concept of online student registration form has emerged as a great relief... will learn to create a student registration form using html code in easy steps
registration form
registration form  Hii.. I have to design one registration page...) { System.out.println("in if"); query = "{call user_create...="center" border=0&gt; &lt;form name="f1" action="CreateUser
Registration Form in HTML
Registration Form in HTML  User Registration Form in HTML - i wanted to design a user registration form in HTML. So, Can anyone please guide me or give me a peace of code to design a user registration form in HTML. Thanks
popup registration form
popup registration form  hi i want a code for popup registration form.when user click a button popup form will appear.thanks.
Login form and registration
Login form and registration  I need a complete code for ligin and new user registration form and validation
form registration on JavaScript
form registration on JavaScript   i want form of registration on JavaScript > < check the name is string or number & if the name number output error >> and the same of email and birthday and country >> <
JSP code for registration form
JSP code for registration form  Haiiii can u please tell me how to encrypt password field in registration form and to compare both password and confirm password fields using jsp
AJAX REGISTRATION FORM
AJAX REGISTRATION FORM  I have implemented user name, check and state selection using ajax, in the html registration form. I am loading two XML... either username or state. How to implement both in same registration form could any
user Registration form using bean
user Registration form using bean   In this code,password and confirm password does n't matches.Every time an error occured if i entered same string for both.Please help to sort my problem
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
registration form using oop concept
registration form using oop concept  I would like to write a program student registration form at kindergartens and display the information... the output?   Registration Form: import javax.swing.*; import java.awt.
How to create form in Swings
How to create form in Swings  How to create registration, login and question form in Java Swing?   Creating different forms in Java Swing - Examples how to create registration form in swing swing login form example
How do I compile the registration form?
How do I compile the registration form?  How do I compile the registration form as stated at the bottom of the following page (URL is below). Do I...://www.roseindia.net/struts/hibernate-spring/user-registration-action.shtml
database spring registration form
user registration jsp form we are many field create Name,UserId, Password...database spring registration form We are going to discuss about  database spring registration form. We have created simple spring registration form
web page for form registration to my department
web page for form registration to my department  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives
Developing User Registration Form
Developing User Registration Form   ... necessary to develop the User Registration Form for our Struts, Hibernate and Spring... how to develop the User Registration Form and related JSP files. This User
how to create a login page and registration page?
how to create a login page and registration page?  hellow, pls tell me the code for how we can create a login page and registration page and how we can store the info in database.only in advance java as jsp
HTML Code for registration form
HTML Code for registration form Here is an example of Registration form using...;Registration form</h2> <form action="Welcome.html" method=".... The name in front of Text Field is called "Label". At the end of the registration
User Registration Form Using JSP(JspBeans)
User Registration Form Using JSP(JspBeans)  ... of user registration form using jsp. One of the basic programming tactics... a simple registration form (register.html):       <
create a form using struts
create a form using struts  How can I create a form for inputting text and uploading image using struts
html code for student registration form
html code for student registration form Here is an example of html code for student registration form. In this example, we have displayed many text fields... in student registration form. If you will not enter value in text field than an error
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access database by using jsp code.i want to urgent jsp code. please urgent sir. thank
userregistration code -- http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml
userregistration code -- http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml  While running this application on netbeans7.0 , i am getting the following error: message /userregister/ description The requested
Develop user registration form
User Registration Form in JSP     ... user registration jsp page.  In this example we will create a simple registration form which will insert  the entered  data into the database
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
Advertisements
 

 

 

DMCA.com