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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


seochat
Using java script do login form having fields with condition.
2 Answer(s)      3 years and 3 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


Advertisement
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
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
Advertisements
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
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
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 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
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 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
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 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 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
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
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
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
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
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
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
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
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
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
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
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
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
 

 

 

DMCA.com