Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Document</title>
- <script type="text/javascript">
- function validate() {
- let x = document.forms.myForm.Email.value;
- if (x == "") {
- alert("Please enter your Email ID");
- document.myForm.Email.focus();
- return false;
- } else if (document.myForm.password.value == "") {
- alert("Please enter your Password");
- document.myForm.password.focus();
- return false;
- } else {
- return true;
- }
- }
- </script>
- </head>
- <body>
- <form action="message.html" name="myForm" onsubmit="return validate()">
- <input type="text" name="Email" placeholder="Email" /><br />
- <input type="password" name="password" placeholder="password" /><br />
- <button type="submit">Submit</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement