Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript">
- function validate()
- {
- var uid=document.getElementById("uid").value;
- var pwd=document.getElementById("pwd").value;
- var flag="true";
- if(uid == null || uid.length<6)
- {
- flag="false";
- alert("username should contain min 6 charactesr");
- document.getElementById("uid").value=" ";
- }
- else if(pwd == null || pwd.length<6)
- {
- flag="false";
- alert("pass min 6");
- document.getElementById("pwd").value=" ";
- }
- if (flag=="false");
- return false;
- }
- </script>
- </head>
- <body bgcolor="brown">
- <form align="center" onsubmit="return validate()">
- usname:<input type="label" name="uid" value=""></br></br>
- passwd:<input type="password" name="pwd" value=""></br><br>
- <button type="submit">Submit</button>
- <button type="button">Reset</button>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment