Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.6 kB
3
Indexable
Never
<html>
    <head>
        <title>password validation</title>
    </head>
    <body>
        <center>
        <h>sapthami</h><br>
        <h>roll no.50</h><br>
        <h>reg no. 20130786</h>
        </center>
        <form onsubmit ="return verifypassword()">
            enter your password : <input type="password" id ="pwd" name="pwd">
            <input type ="submit" value="submit">
            </form>
            <script type="text/javascript">
            function verifypassword() {
                var pw = document.getElementById("pwd").value;
                if(pw.search(/[A-Z]/) < 0)
                {
                    alert("minimum one uppercase");
                    return false;
                }
                else if(pw.search(/[0-9]/)<0)
                {
                    alert("minimum one number");
                    return flase;
                }
                else if(pw.search(/[# *]/) < 0)
                {
                    alert("minimum one # or * symbol");
                    return false;
                }
                else if(pw.lenght > 15)
                {
                    alert("password not more than 15 character");
                    return flase;
                }
                else if(pw.length < 8)
                {
                    alert("password must be atleast 6 character")
                    return flase;
                }
                else
                {
                    alert("successfull");
                }
            }
            </script>
            </body>
            </html>