Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>form-1</title>
- </head>
- <body>
- <form action="register.php" id="registration" method="get">
- Email: <input name="email" type="text"/>
- <br/>
- Password: <input name="password" type="password"/>
- <br/>
- Password again: <input name="confirmation" type="password"/>
- <br/>
- I agree to the terms and conditions: <input name="agreement" type="checkbox"/>
- <br/><br/>
- <input type="submit" value="Register"/>
- </form>
- <script>
- var form = doucument.getElementById('registration');
- form.onsubmit = function() {
- if (form.email.value == '')
- {
- alert('Give email id!');
- return false;
- }
- else if (form.password.value = '')
- {
- alert('Give password!');
- return false;
- }
- else if (form.password.value != form.confirmation.value)
- {
- alert('Passwords dont match!');
- return false;
- }
- else if (!form.agreement.checked)
- {
- alert('agreement unchecked!');
- return false;
- }
- return true;
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement