Results 1 to 2 of 2

Thread: JavaScript for username and password

  1. #1
    ThomasBarnes is offline Senior Member
    Join Date
    Dec 2009
    Posts
    303
    Rep Power
    3

    Default JavaScript for username and password

    Hi everyone. I am developing website using JAVA programming language. For my login form I want to write JavaScript for username and password. If the username and password is correct then it will go to home page and if username and password is wrong it will give error message. Thank you

  2. #2
    HernandezOrtiz is offline Senior Member
    Join Date
    Dec 2009
    Posts
    301
    Rep Power
    3

    Default

    I suggest you to refer following example of JavaScript for username and password

    Code:
    <script type="text/javascript">
    function login()
    { 
      var username=prompt("Enter username");
      var password=prompt("Enter password");
      if(username=="admin" && password=="admin")
       window.location="home.html";
      else
       alert("Invalid username password");
     }
    </script>

Similar Threads

  1. Javascript Password security
    By RussellBarnes in forum Programming
    Replies: 0
    Last Post: 08-06-2010, 02:52 PM
  2. JavaScript for Password Validity Tester
    By HernandezOrtiz in forum Programming
    Replies: 1
    Last Post: 06-12-2010, 11:10 AM
  3. Windows mail continues asking for username and password
    By mark_carter in forum Windows Vista
    Replies: 1
    Last Post: 04-08-2010, 11:52 AM
  4. Recover your ESO username and password in Age of Empires III
    By Gebhard Thomas in forum Gaming Accessories
    Replies: 0
    Last Post: 03-30-2010, 09:35 AM
  5. Replies: 1
    Last Post: 04-24-2009, 01:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48