Registration

Registration

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
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 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
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
to creating a registration form
to creating a registration form  how to create a registration form
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
ModuleNotFoundError: No module named 'registration'
ModuleNotFoundError: No module named 'registration'  Hi, My Python... 'registration' How to remove the ModuleNotFoundError: No module named 'registration' error? Thanks   Hi, In your python
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.
user registration example
user registration example  hello roseindia i'm searching for a user registration application/example using struts can you pls help me
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
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 >> <
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
ModuleNotFoundError: No module named 'automatron-registration'
ModuleNotFoundError: No module named 'automatron-registration'  Hi...: No module named 'automatron-registration' How to remove the ModuleNotFoundError: No module named 'automatron-registration' error? Thanks   
ModuleNotFoundError: No module named 'django-registration'
ModuleNotFoundError: No module named 'django-registration'  Hi, My... named 'django-registration' How to remove the ModuleNotFoundError: No module named 'django-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'matrix-registration'
ModuleNotFoundError: No module named 'matrix-registration'  Hi, My... named 'matrix-registration' How to remove the ModuleNotFoundError: No module named 'matrix-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'napari-registration'
ModuleNotFoundError: No module named 'napari-registration'  Hi, My... named 'napari-registration' How to remove the ModuleNotFoundError: No module named 'napari-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'napari-registration'
ModuleNotFoundError: No module named 'napari-registration'  Hi, My... named 'napari-registration' How to remove the ModuleNotFoundError: No module named 'napari-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'opps-registration'
ModuleNotFoundError: No module named 'opps-registration'  Hi, My... named 'opps-registration' How to remove the ModuleNotFoundError: No module named 'opps-registration' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'stem-registration'
ModuleNotFoundError: No module named 'stem-registration'  Hi, My... named 'stem-registration' How to remove the ModuleNotFoundError: No module named 'stem-registration' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'tgapp-registration'
ModuleNotFoundError: No module named 'tgapp-registration'  Hi, My... named 'tgapp-registration' How to remove the ModuleNotFoundError: No module named 'tgapp-registration' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'thunder-registration'
ModuleNotFoundError: No module named 'thunder-registration'  Hi...: No module named 'thunder-registration' How to remove the ModuleNotFoundError: No module named 'thunder-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'automatron-registration'
ModuleNotFoundError: No module named 'automatron-registration'  Hi...: No module named 'automatron-registration' How to remove the ModuleNotFoundError: No module named 'automatron-registration' error? Thanks   
ModuleNotFoundError: No module named 'cubicweb-registration'
ModuleNotFoundError: No module named 'cubicweb-registration'  Hi...: No module named 'cubicweb-registration' How to remove the ModuleNotFoundError: No module named 'cubicweb-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-registration'
ModuleNotFoundError: No module named 'django-registration'  Hi, My... named 'django-registration' How to remove the ModuleNotFoundError: No module named 'django-registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'djangorestframework-registration'
ModuleNotFoundError: No module named 'djangorestframework-registration' ...: ModuleNotFoundError: No module named 'djangorestframework-registration' How to remove the ModuleNotFoundError: No module named 'djangorestframework-registration'
ModuleNotFoundError: No module named 'edc-registration'
ModuleNotFoundError: No module named 'edc-registration'  Hi, My... named 'edc-registration' How to remove the ModuleNotFoundError: No module named 'edc-registration' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'hanyang_registration'
ModuleNotFoundError: No module named 'hanyang_registration'  Hi...: No module named 'hanyang_registration' How to remove the ModuleNotFoundError: No module named 'hanyang_registration' error? Thanks   Hi
ModuleNotFoundError: No module named 'image_registration'
ModuleNotFoundError: No module named 'image_registration'  Hi, My... named 'image_registration' How to remove the ModuleNotFoundError: No module named 'image_registration' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'itk-registration'
ModuleNotFoundError: No module named 'itk-registration'  Hi, My... named 'itk-registration' How to remove the ModuleNotFoundError: No module named 'itk-registration' error? Thanks   Hi, In your
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
Registration Guide This guide is a must for any one wants to register
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
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>
JDBC Connection and Registration
stored in database. How to validate user registration. Thanks in advance...); } } } Validate User Registration
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
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
Registration timer expired, but client is still registering!
Registration timer expired, but client is still registering!  Registration timer expired, but client is still registering
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
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
Registration
An Analytical Approach to Optimizing Parallel Image Registration/Retrieval
An Analytical Approach to Optimizing Parallel Image Registration/Retrieval  how to do
java code for registration and login pages, mysql as a bankend.
java code for registration and login pages, mysql as a bankend.  please send me the java code for registration and login pages and to store the data in mysql
Version of com.mercadopago>registration-sdk-android dependency
List of Version of com.mercadopago>registration-sdk-android dependency

Ads