0% found this document useful (0 votes)
776 views

Css Practical No 6

The document is a HTML webpage that contains a login form with username and password fields. It uses JavaScript functions to validate the username and password entries. The emailValidate() function checks if the entered username matches a predefined email and displays the validation result. The validate() function checks if the password matches for a valid login and displays an alert message with the login status.

Uploaded by

Mayur Narsale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
776 views

Css Practical No 6

The document is a HTML webpage that contains a login form with username and password fields. It uses JavaScript functions to validate the username and password entries. The emailValidate() function checks if the entered username matches a predefined email and displays the validation result. The validate() function checks if the password matches for a valid login and displays an alert message with the login status.

Uploaded by

Mayur Narsale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical No.

<!DOCTYPE html>
<html>
<head>
<center>
<h1>CSS : Practical No 6</h1>
<h2>Create a webpage using Form Elements</h2>
<br><br>
<script type='text/JavaScript'>
function emailValidate()

{
var a = document.loginForm.user.value;
var h5 = document.getElementById("email");
h5.innerHTML = a;
if(a == "[email protected]")
{
h5.innerHTML = "Correct Email
ID"; return "ok";
}
else
{
h5.innerHTML = "InCorrect Email
ID"; return "not ok";
}
}
function validate()
{
var res =
emailValidate(); if(res
== "ok")
{
var pass = document.loginForm.pass.value;
console.log(pass);

if(pass == "Unknown@123456")
{
alert("Login Success");
}
else
{
alert("Login UnSuccess");
}
}
}
</script>
</center>
</head>
<body>
<form name="loginForm" action="" method="POST" >
<fieldset>
<legend> Login Details </legend>
Username: <input type="text" name="user" onkeyup="emailValidate()" />
<h5 id="email"> </h5>
Password: <input type="text" name="pass"/><br><br>
<input type="submit" onclick="validate()" />
</fieldset>
</form>
</body>
</html>
Output :-

You might also like