HTML login page code

HTML login page code

Hi all, I am writing my first HTML JavaScrip validation page called "UserLogin.html". So, please guide me how to validate user and password feild in JavaScript?

If possible then please provide me the complete HTML JavaScript code for User Login Page.

Thanks in Advance!

View Answers

January 2, 2013 at 3:21 PM

function checkForm(form)
{
  if(form.username.value == "")
{
  alert("Error: Username cannot be blank!");
  form.username.focus();
  return false;
}
re = /^\w+$/;
if(!re.test(form.username.value)) {
  alert("Error: Username must contain only letters, numbers and underscores!");
  form.username.focus();
  return false;
}

if(form.pwd1.value != "" && form.pwd1.value == form.pwd2.value) {
  if(form.pwd1.value.length < 6) {
    alert("Error: Password must contain at least six characters!");
    form.pwd1.focus();
    return false;
  }
  if(form.pwd1.value == form.username.value) {
    alert("Error: Password must be different from Username!");
    form.pwd1.focus();
    return false;
  }
  re = /[0-9]/;
  if(!re.test(form.pwd1.value)) {
    alert("Error: password must contain at least one number (0-9)!");
    form.pwd1.focus();
    return false;
  }
  re = /[a-z]/;
  if(!re.test(form.pwd1.value)) {
    alert("Error: password must contain at least one lowercase letter (a-z)!");
    form.pwd1.focus();
    return false;
  }
  re = /[A-Z]/;
  if(!re.test(form.pwd1.value)) {
    alert("Error: password must contain at least one uppercase letter (A-Z)!");
    form.pwd1.focus();
    return false;
  }
} else {
  alert("Error: Please check that you've entered and confirmed your password!");
  form.pwd1.focus();
  return false;
}

alert("You entered a valid password: " + form.pwd1.value);
return true;
}

January 2, 2013 at 5:19 PM

html registration form code with validation

<html>
<body>
<form>
<table width="35%" height="30%" bgcolor="#FFFF66" align="center">

    <tr>        
        <td colspan=2><font size=3><center><b>HTML Login Page Code</b></center>     
    </tr>
    <tr>
        <td width="30%"><b>Name:</b><br/></td>
        <td><input type="text" size=25 maxlength=20 name="userid"></td>
    </tr>
    <tr>
        <td width="30%"><b>Password:</b><br/></td>
        <td><input type="Password" size=25 maxlength=20 name="pswrd"></td>
    </tr>

    <tr>
        <td ><input type="Reset">
        <input type="submit" onclick="check(this.form)" value="Login"/>
    </tr>

</table>
</form>
<script language="javascript">
function check(form)/*function to check userid & password*/
{
 /*the following code checkes whether the entered userid and password are matching*/
 if(form.userid.value == "user1" && form.pswrd.value == "pass1")
  {
    window.open('target.html')/*opens the target page while Id & password matches*/
  }
 else
 {
   alert("Error Password or Username")/*displays error message*/
  }
}
</script>

</body>
</html>









Related Tutorials/Questions & Answers:
HTML login page code
the complete HTML JavaScript code for User Login Page. Thanks in Advance!   ...HTML login page code  Hi all, I am writing my first HTML JavaScrip...;td colspan=2><font size=3><center><b>HTML Login Page
what is the code for login page in html
what is the code for login page in html  Hi, I am total beginner in HTML coding. I want to make a login page in HTML to understand the form coding. I think login page is goot topic to start and learn. what is the code for login
Advertisements
what is the code for login page in html
what is the code for login page in html  Hi, I am total beginner in HTML coding. I want to make a login page in HTML to understand the form coding. I think login page is goot topic to start and learn. what is the code for login
what is the code for login page in html
what is the code for login page in html  Hi, I am total beginner in HTML coding. I want to make a login page in HTML to understand the form coding. I think login page is goot topic to start and learn. what is the code for login
HTML Login Page Code
HTML Login Page Code Here is an example of html login page code... on their credentials. For making login page for websites HTML form and HTML elements... But in this tutorial you will learn to create a login page in HTML and validate
html login page with ajax
html login page with ajax  hi all... i want to create a login page using html and ajax for validation is must. please help me doing that with code...=="yes"){ alert("Welcome User"); }else{ alert("Invalid Login! Please try again
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
program code for login page in struts by using eclipse
program code for login page in struts by using eclipse  I want program code for login page in struts by using eclipse
How to create simple HTML Login Page?
How to make Spring web Login form? HTML Login Page Code...Simple HTML Login Page- Create a Simple HTML Login page and validate... with JavaScript. You will  learn How to create a simple HTML login page
How to create simple HTML Login Page?
? HTML Login Page Code Spring 4 MVC Login form Example...Simple HTML Login Page- Create a Simple HTML Login page and validate... with JavaScript. You will  learn How to create a simple HTML login page
code for user registration page and login page of emails using jsp
code for user registration page and login page of emails using jsp  hiiiiiii please send me the code for user registration page and login page of email using jsp and servlets and also code for database connectivity to oracle
login page
login page  code for login page
View source code of a html page using java ..
View source code of a html page using java ..  I could find the html source code of a web page using the following program, http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLConnection.html i could get the html code
facebook login button html
facebook login button html  facebook login button html i have a facebook login button code ..but not sure how to use it. Can any one please explain? Here is the facebook login button code in html <fb:login-button
Login page
Login page  how to create Login page in java
Login Page
Login Page  Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ??? Please tell me
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one... page..."); log.info("Login page loaded successfully."); return...="com.credentek.recon.sms.action.IndexAction" method="login"> <
login page
login page  hi i'm trying to create login page using jsp. i get... the program. Following are my programs... 1.index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page
swing login code
swing login code  code for the login form
php login and logout code
php login and logout code  Hi, Can anyone share there code for creating a user login and logout page in PHP?or any useful tutorial that can help to create a login and logout application in PHP.. Thanks in Advance
login page
login page  pls say how to create a login page in jsp and mysql using netbaens   Hi Friend, Please visit the following links:ADS_TO_REPLACE_1 http://roseindia.net/jsf/netbeans/index.shtml http://roseindia.net/jsp
login page
login page  How to login as different user in php
HTML code
HTML code  How do I keep people from stealing my source code and/or images
LOGIN PAGE
LOGIN PAGE  A java program with "login" as title,menus added, and a text field asking for firstname, lastname, and displaying current date and time
coding for login page
coding for login page  coding for login page
code for login fom - Struts
code for login fom  we have a login form with fields USERNAME: PASSWORD: In this admin can login and also narmal uses can log
login page in php
login page in php  How to create a login page in php
HTML Color Code for White
HTML Color Code for White In this page you will find the hexadecimal color code for White color. The hexadecimal color code for white is #FFFFFF or #ffffff. For most website white color is used as the background of the web page
jsp login page
jsp login page  hi tell me how to create a login page using jsp and servlet and not using bean... please tell how to create a database in sql server... please tell with code
html code for student information?
html code for student information?  html code for student information
need code for login in asp.net with c#
need code for login in asp.net with c#  hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance
Spring Login Page Error
Spring Login Page Error  Dear Sir/Madam, I used the spring login page code. The index page is working fine. When i try to entry login and password , i am getting the below error: Please help me out in this. Let me know if i
SSL for login page
SSL for login page  I am trying to apply ssl cert to login page only. Does anyone know how to do this on a tomcat web server
generate java code and html code - Java Beginners
generate java code and html code  create a web application for museum....a)the first page wil be a login page for administrators.. passwords for all acounts should be stored in the database and checked on login... on success ogin
HTML link code.
HTML link code. Description : It is also called hyper link. HTML provides a tag called anchor, which is used for transferring control from one page...;/a> Code : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
HTML Color Code for purple
HTML Color Code for purple In this page you will find the hexadecimal color code for Purple color. The hexadecimal color code for dark purple is #800080... look. See more at HTML color codes page
login page error
login page error  How to configure in to config.xml .iam takin to one login form in that form action="/login" .when iam deployee the project... this request." please suggest me.   if your login page is prepared
What is the use of Login Page?
Form? How to create simple HTML Login Page? HTML Login Page Code HTML Code for registration form... simple HTML Login Page? In case native applications such as Android or iOS login
JSP LOGIN Page
JSP LOGIN Page  sir....i have two user types usercategory and user and both user have userid and password in two different table and now i am making login page for which i have to retrieve usertype,userid and password from two
login page with image
login page with image  I am writing program for login page.It consists of a image and the login details... how to write a java program using frames that have the default positions in any of the systems.. thanks   i had
Login page validation on ipad
Login page validation on ipad  I am using userId & password... by single sign in button and want to switch on to next page. Used two labels again... the code or resorse for the same. Plz its urgent
login page - Java Beginners
login page  I have one login page in jsp that is login.jsp. Now i have validate user from database by another page validate.jsp. but if the user feeded wrong information then i want to print error massege on the first page
HTML - Strikethrough code.
HTML - Strikethrough code. Description : The strike is a html tag. When you... Markup Language</strike> Code : <!DOCTYPE html PUBLIC ".../TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http
jsp login page
jsp login page  Hi All, can any one tell me how to create Login page using JSP and Beans. A simple log in page. Please reply ASAP.ADS...:ADS_TO_REPLACE_2 JSP Login Using Bean Thanks   Hi,ADS_TO_REPLACE_3
Pagination example with html code
Pagination example with html code  Hi, could u please provide pagination code with clear cut explanation. Thanks in advance
HTML - Image link code.
HTML - Image link code. Description : HTML image link is a combination... is  used as a text of anchor tag. Code : <!DOCTYPE html PUBLIC...;h1>Example of HTML Link code.</h1> <p>Please visit
login page validation
login page validation  hi could you please send me code for login validations Email validation and password email should be in correct format and valid password in java   import java.awt.*; import javax.swing.
Html Code - Development process
Html Code  Hi,Can u give me code for Html . headers are Date, Name and Dept . Inside Date column i want to split 2 columns. like In and Out. I have tried colspan tag , but i couldnt get d output. Thank u in advance 
JSP Login Page Question
JSP Login Page Question  hey..i have a login page where different users first registered and then after they can login. my question is how a user can see only his data after login where different users data are stored
Sending form data from HTML page to SQLserver 2005 database by calling servlet code
from html page to database by calling servlet code from html page .   Hello Friend, Try the following code: 1)callServlet.html:ADS_TO_REPLACE_1 <...Sending form data from HTML page to SQLserver 2005 database by calling servlet

Ads