Web Analytics Made Easy -
StatCounter Click on picture to execute password check to go to new page - CodingForum

Announcement

Collapse
No announcement yet.

Click on picture to execute password check to go to new page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Click on picture to execute password check to go to new page

    I've been hunting around for this for a while and can't quite seem to get it to work. I'm working on Google Sites so the code can be either Javascript or HTML

    What I want to happen is that when a user clicks on a picture, it executes code that asks for a password. If the password is entered correctly, it sends to user to a webpage. If its not correct, it closes the dialog box.

    I don't need high security (this is for beginning web design students) so I don't mind that the password can be seen in the source code.

    I could have sworn this would be a trivial task, yet after trying 20+ different examples from all over, I can't get anything to work. I've seen some options that use onclick with the image to call a function. Two problems with this strategy, onclick doesn't seem to work with Google Sites and I don't think I can define a function in an HTML box that the image would be able to access.

    Worst case, if I can't have this happen with clicking on the picture, I could have the password box open all the time as its own object, and as soon as they type in the correct password, it sends them to the new page.

    Thanks for any help!

  • #2
    Show one or two of your best attempts.

    Comment

    Working...
    X