Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Demo</title>
- </head>
- <body>
- Username : <input type="text" id="user"><br><br>
- Password : <input type="password" id="pass"><br><br>
- <button onclick="Sbmt()">Submit</button>
- <script type="text/javascript">
- function Sbmt() {
- var usr = document.getElementById('user').value;
- var pas = document.getElementById('pass').value;
- if(usr == "" || pas == "") {
- alert("Please Enter Username and Password...");
- } else if (pas.length < 6 || pas.length > 12) {
- alert("Password not valid...");
- } else if (usr.charCodeAt(0) > 65 || usr.charCodeAt(0) < 90 || usr.charCodeAt(0) > 97 || usr.charCodeAt(0) < 122 ) {
- alert("Welcome");
- } else {
- alert("Not valid Username..");
- }
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment