Home Answers Viewqa Java-Beginners Using java script do login form having fields with condition.

 
 


seochat
Using java script do login form having fields with condition.
2 Answer(s)      a year and 11 months ago
Posted in : Java Beginners

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 Pages:
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
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
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
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 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
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
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
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
Mandatory Fields Validation - Java Beginners
Mandatory Fields Validation  In my login servlet, i have fields...:   form, login application... has been left blank. Please help  Hello, you can do this through
Initialising Fields before Superconstructor call - Java Tutorials
legitimate Java code, so I do not have a problem using it in production code... Initialising Fields before Superconstructor call 2004-03-19 The Java Specialists' Newsletter [Issue 086] - Initialising Fields before Superconstructor
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 of the application
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
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
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
Struts 2.1.8 Login Form
to validate the login form using Struts 2 validator framework. About the example: This example will display the login form to the user. If user enters Login Name... Struts 2.1.8 Login Form      
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
Sitemap Java Script Tutorial
with JavaScript | Form validation using Regular Expression in JavaScript | Email validation is JSP using JavaScript | Java Script Code of Calendar... | Conditions In Java Script | Looping in JavaScript | Functions in JavaScript
java script - JSP-Interview Questions
java script  i want that my registration page shud be get poped up when i will clik a on a link on my login page....how can i do it using java script or i shuld use html
Java Script
Java Script  I want to display an error message for the validation of email at the top of the page in red font i want to use java scripts but i dont want to use alert box what i need to do   <html> <script>
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
Having problem with image upload....
Having problem with image upload....  I am uploading profile pictures... caching problems.Please help me.I am using JSP.   1)page.jsp: <%@ page language="java" %> <HTML> <HEAD><TITLE>Display file
login
java.awt.event.*; class Login { JButton SUBMIT; JLabel label1,label2; final JTextField text1,text2; Login() { final JFrame f=new JFrame("Login Form...login  sample java awt/swing code to make loginpage invisible after
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
Example of login form validation in struts2.2.1framework.
Example of login form validation in struts2.2.1 framework. In this example, we will introduce you to about the login form validation in struts2.2.1 framework. Our login form validation example does not validate the user against
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
form values in java script - Struts
form values in java script  how to get form values in java script functions with struts1.1
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.
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
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am... to enter by using a form that asks for a UserID and Password*/ function pasuser(form... help me to validate username and password by using combo box..... Please Help Me
Jdbc Login Page Validation using Combobox
Jdbc Login Page Validation using Combobox  I am beginer to java i am... to enter by using a form that asks for a UserID and Password*/ function pasuser(form... help me to validate username and password by using combo box..... Please Help Me
The while and do
a particular condition is true. To write a while statement use the following form... that the condition becomes false and the loop terminates. Have a look at do... While and do-while      
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
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
qunit jquery with java script
qunit jquery with java script  hi deepak How to write a javascript code and do the test by using qunit sample application and as I am new to testing how to setup the environment for java script testing? where should I run
validating text fields - Swing AWT
the constructor to * initialize the form. * WARNING: Do NOT modify this code...validating text fields  hi i am using NETBEANS IDE so when i want... javax.swing.JFrame { /** Creates new form SAdd */ public SAdd
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
java script - JSP-Servlet
java script  what is the use of hidden fields in java script? if a page has 3 links the first link should be enabled and others should be disabled. once the form inside the first link is filled and submitted the next link should
upload image and fields.....fields is id name.....
upload image and fields.....fields is id name.....  Get Data using Java Servlet The frame takes following input.. Id: Name: browse:Image are file
Login form in jscript
Login form in jscript  For example the html script is <...; charset=utf-8" /> <title>:: validation form::</title> <script...;td align="center" valign="top"> <form name="form1" onsubmit
Login Form in Swing
Login Form in Swing       This section illustrates you how to create a Login form. To create a Login Form, we have used two class files: 1) NextPage.java 2) LoginDemo.java
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
java script
java script  how to write a Java script program to enter number in two text fields and then automatically display the total in another text field
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
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
Java script
Java script  Source code for capturing the screen using Java Script

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.