home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Internet / jvscript116beta / JvScript / !JvScript / Resources / Scripts / Password / 1 next >
Encoding:
Text File  |  1999-08-24  |  702 b   |  31 lines

  1. #newformat
  2. # © Geoff Youngs, 1999
  3. _title:Passworded button link
  4. _description:User clicks on a button which brings up the prompt for a password
  5. _caption:Button Caption
  6. _message:Alert text asking for password:
  7. _message:Password:
  8. _url:Location of protected URL:
  9. _insert-in:inhead
  10. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  11. <!--
  12. function pass() {
  13.   var pass=prompt("¤message_object$(1)¤");
  14.   if (pass=='¤message_object$(2)¤') {
  15.     alert("Thankyou");
  16.     location="¤url_object$(1)¤";
  17.   } else {
  18.     alert("Sorry, Wrong Password.")
  19.     close() 
  20.   }
  21. }
  22. // -->
  23. </SCRIPT>
  24. _end-insert:
  25.  
  26. _insert-in:inbody
  27. <FORM>
  28. <INPUT TYPE="button" VALUE="¤caption_object$(1)¤" onClick="pass()">
  29. </FORM>
  30. _end-insert:
  31.