www.webdeveloper.com
Results 1 to 3 of 3

Thread: password javascript

  1. #1
    Join Date
    May 2012
    Posts
    3

    password javascript

    <html>
    <head>
    <script type="text/javascript">
    function va()
    {

    var a=document.getElementById("pwd").value;
    var b=document.getElementById("pwd1").value;


    if(a.length==6 || a.length==7 || a.length==8 || a.length==9 || a.length==10)
    {

    if(a==b)
    alert("password match");
    else
    alert("password did not match");
    }
    else
    {
    alert("Enter password betweeen 6-10 charcters");
    }

    }







    </script>
    </head>

    <body>
    <form id="f1">
    password <input type="password" id="pwd" />
    confirm <input type="password" id="pwd1" />

    <input type="button" name="Confir" value="Submit" onclick="va()"/>

    </form>



    </body>

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,674
    and ... ?

  3. #3
    Join Date
    Aug 2007
    Posts
    3,767
    What Padonak said, but also:
    Code:
    if (a.length >= 6 && a.length <= 10)
    Is a little more managable!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles