Results 1 to 2 of 2

Thread: [JavaScript] TextBox, keydown, other page..

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    [JavaScript] TextBox, keydown, other page..

    Hello on my website i have a textbox on the first page. I want it so the users enter a specific password in the textbox, click the enter key on their keyboard and/or a button on the screen and then if the password for example eqauls "12345" then the user will advance to "http://www.mywebsite.com/secretpage.html".

    Also since the above website is suppose to be a 'secretpage' i dont want the user able to just type that link on the addressbar and bypass my password. What can i do about this?

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: [JavaScript] TextBox, keydown, other page..

    I don't need it so much encrypted etc.. so i am using this code:

    Code:
    <script language="javascript">
    var pswrd = "321369"
    var confirmation = prompt("Please enter the password below! If you enter an incorrect password you will be transfered to the homepage!")
    if (confirmation==pswrd) {
    alert("Password correct! You may continue.")
    }
    else
    {
    alert("Password invalid! You will now be transfered to the homepage!")
    window.location = "\Index.html"
    }
    </script>

Posting Permissions

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



Click Here to Expand Forum to Full Width