Using java script do login form having fields with condition.

Using java script do login form having fields with condition.

Need a login form with username, password, phone no, email id, date fields. We should specify the conditions for each field and if we press the submit button conditions of each field should appear. ex :*First name cannot be empty

Last Name cannot be empty

Email id cannot be empty

Password Cannot Be Empty

Conform Password cannot be empty

Phone Number Should Not Be Blank

if we given first name then first name cannot be empty should removed.

The submission should be uneven may be we can give date as first field and press submit submit button. I need this requirement pls help me out. thanx for answer

View Answers

June 20, 2011 at 5:34 PM

<html>
<script>
function validate(){
    if(document.form.fname.value == ""){
        alert( "First Name cannot be empty" );
        document.form.fname.focus();
        return false;
    }
    if(document.form.lname.value == ""){
        alert( "Last Name cannot be empty" );
        document.form.lname.focus();
        return false;
    }
    if(document.form.email.value == ""){
        alert( "Email cannot be empty" );
        document.form.email.focus();
        return false;
    }
    if(document.form.pass.value == ""){
        alert( "Password cannot be empty" );
        document.form.pass.focus();
        return false;
    }
    if(document.form.cpass.value == ""){
        alert( "Confirm Password cannot be empty" );
        document.form.cpass.focus();
        return false;
    }
    if(document.form.phone.value == ""){
        alert( "Phone Number cannot be empty" );
        document.form.phone.focus();
        return false;
    }
    return true;     
   }  
</script>
<form name="form" method="post" onsubmit="return validate();">
<table>
<tr><td>Enter First Name</td><td><input type="text" name="fname"></td></tr>
<tr><td>Enter Last Name</td><td><input type="text" name="lname"></td></tr>
<tr><td>Enter Email ID</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>Enter Phone No</td><td><input type="text" name="phone"></td></tr>
<tr><td></td><td><input type="submit" value="Add" name="button"></td></tr>
</table>
</form>
</html>

June 20, 2011 at 5:37 PM

Need a login form with username, password, phone no, email id, date fields. We should specify the conditions for each field and if we press the submit button conditions of each field should appear. ex :*First name cannot be empty

Last Name cannot be empty

Email id cannot be empty

Password Cannot Be Empty

Conform Password cannot be empty

Phone Number Should Not Be Blank

if we given first name then first name cannot be empty should removed.

The submission should be uneven may be we can give date as first field and press submit submit button. I need this requirement pls help me out. thanx for answer









Related Tutorials/Questions & Answers:
Using java script do login form having fields with condition.
Using java script do login form having fields with condition.  Need a login form with username, password, phone no, email id, date fields. We should specify the conditions for each field and if we press the submit button
java login form using netbeans
java login form using netbeans  how to connect an access database to a login form using netbeans
Advertisements
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
login form using java bean in eclipse
login form using java bean in eclipse  I have made a college community website but i need to implement beans to my login and contact us page. how can i do
Login Form with Java GUI using Netbeans
Login Form with Java GUI using Netbeans  Hi there! I'm a beginner in Java. I've created 2 class files: 1) TestAssign.java 2) NewFrame.java How can I have different user to login? Now that I've only administrator who is able
form to java script conversion
form to java script conversion  I am using a form one more form cotain a piece of code . how to convert it to java script to function it properly? code is shown below <form action="http://www.google.com" id="cse-search
Login Form using Ajax
Login Form using Ajax       This section provides you an easy and complete implementation of login form...; </action> Develop a Login Form Using Ajax : The GUI
form values in java script - Struts
form values in java script  how to get form values in java script functions with struts1.1
Login form using Jsp in hibernate - Hibernate
Login form using Jsp in hibernate   Hai Friend, As I new To hibernate, I'm facing problem in My project(JSP with hibernate).. My login form... and entering into Menu Form.. plz can any one help for my problem... Thanks
Login Form in Java - Java Beginners
Login Form in Java  Hi, In my Project, I am using Java-JDBC-Mysql...) How to create frontage form in java to validate it. regards, Prashant... Authenticated person can access these module. I create table in my-sql where fields
standart login form for messenger in java
standart login form for messenger in java  hi i need login from for chating messenger in java. but its structure would like this Home Register Login User ID Password   Hi Friend
standart login form for messenger in java
standart login form for messenger in java  hi i need login from for chating messenger in java. but its structure would like this Home Register Login User ID Password   Hi Friend
javascript script tag fields - Java Beginners
javascript script tag fields  hi all, i wanted to know what is meaning of type property in javascript script tag? In most cases we write type... of tag specifies the MIME type of a script. Javascript is the default scripting
How to put the logo in login form using swings/awt?
How to put the logo in login form using swings/awt?  Hi, How to put the logo in login form using swings/awt? I write the login form is working... that will display logo along with login form in Java Swing. import javax.swing.
add cookies to login form in jsp by using struts2.0 framework
add cookies to login form in jsp by using struts2.0 framework  hi sir... struts2.0 and hibernate3.0 and mysql database for login .jsp now i want to add cookies to above form please help me
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
login form
login form  sir my next form consists logout button when i click on it it showing login form but next form window is not closing but the components prepsent in that form are getting clearedup using frameobject.setVisible(false
Login Form
of +,on clicking which a login form appears. Only the middle column is different for each of the page. How to write a code for login authentication so...Login Form  I have 8 jsp pages.Each of them has three columns:Left
Login Form
of +,on clicking which a login form appears. Only the middle column is different for each of the page. How to write a code for login authentication so...Login Form  I have 8 jsp pages.Each of them has three columns:Left
login and registration form using servlet and authentication through mysql
login and registration form using servlet and authentication through mysql  i made a simple login and rgistration form using servlet... help here is my code...plz chk the web.xml file also index.jsp(login form) <
Display Logo on login form using swing
Display Logo on login form using swing In this tutorial, you will learn how to display a logo in login form using swing components. Here is an example where... a logo for this login form, we have used ImageIcon class that accepts the image
login form
login form  sir my next form consists logout button when i click on it it showing login form but next form window is not closing but the components prepsent in that form are getting clearedup using frameobject.setVisible(false
How do i validate form using javascript and send data to database?
How do i validate form using javascript and send data to database?  I need a "JOIN US" form that can validate using javascript and be able to connect...(); return false; } return true; } </script> <form name="form" method
Login With Drop Down, Having Departments in different table
Login With Drop Down, Having Departments in different table  Hi all.... And my issue is I want to login using different departments Customs and Accounts... with the Database during Login. One of my friend suggest me to use if(option.equals) condition
barcode reader using java script
barcode reader using java script  Hai all, I need code for one application in java and java script my requirement is, Scanning data directly into a field is the easiest of all implementations. The cursor is placed
Spring Security Authorized Access Using Custom Login Form
Spring Security Authorized Access Using Custom Login Form In this section, you will learn about  authorized access using custom login form in Spring... access by providing  customized Login form using Spring Security. User
administrator login form
administrator login form   Hi iam using struts frame work backend as oracle .i want code for administrator login form thanks in advance
How to design a form using java?
How to design a form using java?  Please help in designing of form using java for my project
Displatying java script form submitted elements in another page
Displatying java script form submitted elements in another page   hi I want java script and html code for displaying the values in other pager after submitting the registration form. I want to get the values after submitting
Spring alternative to Form Based Login
we make a server to listen to login event i.e. Authenticate a user not using jsp. Using a login form we can use the jspringsecurity_check. How can we do it by sending a web service call and not using any form based authentication
Spring 4: Login Form using Spring MVC and Hibernate Example
Spring 4 MVC Login Example: Database driven login form using Spring MVC... Here is the video tutorial of "Login Form using Spring MVC... Login form application in Spring MVC 4. In this section we will teach you how
Login form and registration
Login form and registration  I need a complete code for ligin and new user registration form and validation
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
login form validation - JSP-Servlet
login form validation  hi, how to validate the login form that contains user name and password using post method . the validation should not allow user to login in the address bar thanks regards, anand
Spring login form application
Spring login form application  Hi Please give me the Spring login form application so that i can understand its flow ?   Hi please find the link of the tutorial Spring Applications
Login Form in SWT
Login Form in SWT       This section illustrates you how to create Login Form. To create a login... GridLayout(2, false)) sets the layout of the login form. The method setTextLimit(30
Database driven login form - Java Server Faces Questions
Database driven login form  Dear sir,madam, Greetings!! well, am a new user of java and i am programming using the netbeans IDE, what i need is code that; will create a database driven login form where users are authenticated
Pagination with condition using servlet or jsp
Pagination with condition using servlet or jsp  Hi, Thanks... box and one submit button, After clicking the submit button that form field value I retrieved using "String name=request.getParameter("name of that text box
Tracking User's Session using Hidden Form Fields
Tracking User's Session using Hidden Form Fields In this Section, We will discuss about tracking user's session using Hidden form field. Hidden...;BODY> <H3>Included Hidden fields with this Form </H3>
Hit Counter Schema using java script - WebSevices
Hit Counter Schema using java script   Dear Sir, I am sending you none project i need you help please tell me how to do it? first I have to maintain a cookie, however me choose to do it. The cookie will be maintained
Login Form
for a login form using struts. UserLoginAction Class: When you download Login... Login Form       Login form in struts: Whenever you goes to access data from
load testing for login using - Java Beginners
load testing for login using  Hi , I am new to Jmeter.How can i test Login funcionality when 10 different users logging with a gap of 10 sec each.Please tell me the process to do it.Thanx, Naryana
form field mapping with pdf file using java
form field mapping with pdf file using java   Hai all, I have one requirement that i have one html form.i have to map the form fields with pdf file. means, if click on text field according that perticular field .the data
login form - JSP-Servlet
login form  Q no.1:- Creat a login form in servlets?  Hi...*; import javax.servlet.http.*; public class Login extends HttpServlet...(); pw.println(""); pw.println("Login"); pw.println(""); pw.println
store pagination form fields - Struts
store pagination form fields   hi,iam working online exams project... table. here iam using pagination for questions to be displayed to client... approach this task. iam using jstl in jsp to iterate the list object of different
insert Images using if condition on a button in NetBeans
insert Images using if condition on a button in NetBeans  I wantted to insert Images using if condition on a button that is performed to change the picture on one single label. how shuold i do this ? and also give me an example
php form having 2 submit buttons
php form having 2 submit buttons  i have a php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button the data from form should go in mysql database and mail should go to appropiate
ModuleNotFoundError: No module named 'django-rest-form-fields'
ModuleNotFoundError: No module named 'django-rest-form-fields'  Hi...: No module named 'django-rest-form-fields' How to remove the ModuleNotFoundError: No module named 'django-rest-form-fields' error? Thanks   
ModuleNotFoundError: No module named 'django-dynamic-form-fields'
ModuleNotFoundError: No module named 'django-dynamic-form-fields'  Hi...: No module named 'django-dynamic-form-fields' How to remove the ModuleNotFoundError: No module named 'django-dynamic-form-fields' error? Thanks
ModuleNotFoundError: No module named 'django-extra-form-fields'
ModuleNotFoundError: No module named 'django-extra-form-fields'  Hi...: No module named 'django-extra-form-fields' How to remove the ModuleNotFoundError: No module named 'django-extra-form-fields' error? Thanks  

Ads