Created
January 3, 2016 07:03
-
-
Save RobbiNespu/fc74ba25864b5380db98 to your computer and use it in GitHub Desktop.
Javascript +html = username and password validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SCRIPT Language="JavaScript"> | |
<!-- | |
function Form_Validator(theForm) | |
{ | |
if (theForm.usernameID.value == "" ) | |
{ | |
alert("Please Key-In Your Username !"); | |
theForm.usernameID.focus(); | |
return (false); | |
} | |
if (theForm.passwordID.value == "" ) | |
{ | |
alert("Please Key-In Your Password !"); | |
theForm.passwordID.focus(); | |
return (false); | |
} | |
return (true); | |
} | |
//--> | |
</SCRIPT> | |
<form id="loginForm" name="loginForm" method="post" action="checklogin.php" onSubmit="return Form_Validator(this)"> | |
<input type="text" name="usernameID" size="25"> | |
<input type="password" name="passwordID" size="25"> | |
<input type="submit" name="Submit" value="Login" /> | |
</form> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment