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



Home Answers Viewqa Ajax Registration
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


santosh
Registration
2 Answer(s)      6 years and 8 months ago
Posted in : Ajax



Advertisement
View Answers

May 14, 2008 at 6:03 PM


hi friend,

<html>
<title>registration form in jsp</title>
<head>

<script type="text/javascript">

function checkEmail(email) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
return (true)
}
alert("Invalid email address.Please Enter again.")
return (false);
}

function validateForm(theForm){



if(theForm.user_name.value==""){

//Please enter username

alert("Please enter User Name.");

theForm.user_name.focus();

return false;

}



if(theForm.lastname.value==""){

//Please enter lastname

alert("Please enter Last Name.");

theForm.lastname.focus();

return false;

}

if(theForm.email.value==""){
alert("Please enter email!");
theForm.email.focus();
return false;
}
if(!checkEmail(theForm.email.value)){
theForm.email.focus();
return false;
}

if(theForm.position.value==""){

//Please enter position

alert("Please enter Position.");

theForm.position.focus();

return false;

}
if(theForm.salary.value==""){

//Please enter salary

alert("Please enter salary.");

theForm.salary.focus();

return false;

}

return true;
}
</script>
</head>

<body>

<table border="1" width="50%" bgcolor="pink">
<tr>
<td width="100%">
<form method="POST" action="RegistrationAction.jsp" onsubmit="return validateForm(this);">

<h2 align="center">User registration form</h2>
<table border="1" width="100%">
<tr>
<td width="50%"><b>User Name:</b></td>
<td width="50%"><input type="text" name="user_name" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Last Name:</b></td>
<td width="50%"><input type="text" name="lastname" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Email:</b></td>
<td width="50%"><input type="text" name="email" size="20"/> </td>
</tr>
<tr>
<td width="50%"><b>Position:</b></td>
<td width="50%"><input type="text" name="position" size="20"></td>
</tr>
<tr>
<td width="50%"><b>Salary:</b></td>
<td width="50%"><input type="text" name="salary" size="20"></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="submit">
<input type="reset" value="Reset" name="reset"></p>

</form>
</td>
</tr>
</table>

</body>

</html>


May 14, 2008 at 6:04 PM


<%@ page language="java" import="java.sql.*" %>

<%
Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
try{
Statement st = con.createStatement();
String username=request.getParameter("user_name");
String lastname=request.getParameter("lastname");
String email=request.getParameter("email");
String position=request.getParameter("position");
String salary=request.getParameter("salary");

int val = st.executeUpdate("insert user_Register values(id,'"+username+"','"+lastname+"','"+email+"','"+position+"','"+salary+"')");

con.close();
out.println("successfully insert data into database!");

}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}

%>

--------------------------

read for more information,

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


Related Tutorials/Questions & Answers:
course registration
course registration  project for course registration system in java programming
registration application
registration application  How to develop a registration application in struts which has seperate file for database connection and data checking and form and action
Advertisements
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
user registration
user registration  hi frnds...am working on a project in JSP.i want to create a user registration form with username,password,mail id and check box option for community selection.once the details are registered i want to save
REGISTRATION OF MBEAN
REGISTRATION OF MBEAN  my question is... i have installed jboss, and created a managed Bean(MBEAN)and provided interface and everything. but i dont know whether the service registerd in jmx or not. please suggest me
Registration - Ajax
Registration  i want to create a registration page. in which User... me on this topic. How i can connect this registration page to data base. i am...;hi friend, registration form in jsp function checkEmail(email
registration form
registration form  Hii.. I have to design one registration page in java that looks like REGISTER USERNAME (here i have to check whether username already exists in database) EMAIL ADDRESS (here i have to check whether
to creating a registration form
to creating a registration form  how to create a registration form
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
user registration example
user registration example  hello roseindia i'm searching for a user registration application/example using struts can you pls help me
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.
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
Login form and registration
Login form and registration  I need a complete code for ligin and new user registration form and validation
registration key - Java Beginners
registration key  I want the serial key for JCreator Pro 4.50. I lost it. If any body has it please send
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
Sip Registration - MobileApplications
Sip Registration  I need to registration with sip server using j2me. i use the code of jsr180. but it didnt work. is there any help to register with cordia using j2me? opu
Login & Registration - JSP-Servlet
Login & Registration  Pls tell how can create login and registration step by step in servlet. how can show user data in servlet and how can add and remove user only in servlet.   Hi Friend, Please visit
Domain Registration Guide
and test your website. Domain Name Registration Guide This guide
Registration page with JavaScript Validation
Registration page with JavaScript Validation   HTML Registration page with JavaScript Validation - required source code   Registration page in HTML with JavaScript Validation source code <html> <head>
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
JDBC Connection and Registration
stored in database. How to validate user registration. Thanks in advance...); } } } Validate User Registration
student registration example
student registration example  1.reg.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>... visit the following links: http://www.roseindia.net/jsp/user-registration-form
Domain Registration Guide
Domain Registration Guide What is Domain? Internet is the large network of computers. On the Internet there should be some way to identify the computers. Domain name is the solution for this. Domain Name is the unique name
Spring MVC User Registration example
Spring MVC User Registration example  hi, I am unable to find springMVCUserRegistration example full code can u send me full code of this example   Please visit the following link: Spring MVC USer Registration
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
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
Registration timer expired, but client is still registering!
Registration timer expired, but client is still registering!  Registration timer expired, but client is still registering
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
An Analytical Approach to Optimizing Parallel Image Registration/Retrieval
An Analytical Approach to Optimizing Parallel Image Registration/Retrieval  how to do
 

 

 

DMCA.com