Answer to Question #79981 in AJAX | JavaScript | HTML | PHP for Ash Govens

Question #79981
What is a Login Page javascript program that includes the following fields:

1. Input field for username

2. Input field for password

3. Background and picture

4. Title or heading

5. Validation code that will check that the user enters the correct username and password.

6. Instruction to the user

?
1
Expert's answer
2018-08-21T03:58:01-0400

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login Page</title>
<style>
body {
background-color: #BB28FF;
}
</style>
<script type="text/javascript">
function validateForm() {
var log = document.forms["logForm"]["login"].value;
if (log == "") {
alert("Name must be filled out");
return false;
}
var pas = document.forms["logForm"]["password"].value;
if (pas == "") {
alert("Password must be filled out");
return false;
}
}
</script>
</head>
<body>
<img src="https://icons.iconseeker.com/png/fullsize/free-business/sign-in.png">
<h1>Sign In</h1>
<form method="post" name="logForm" onsubmit="return validateForm()">
<input type="text" name="login" placeholder="Write your username"><br>
<input type="password" name="password" placeholder="Write password"><br>

<input type="submit" value="login">
</form>
<h3>Instruction</h3>
<p>First: Enter your login and password in a correct field.</p>
<p>Second: Press "login" button.</p>
</body>
</html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS