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

  1. #newformat
  2. _title:Three Tries
  3. _author:TJS
  4. _description:Allows the user three tries at getting the password correct
  5.  
  6. _caption:Password
  7. _url:Protected URL
  8.  
  9. _insert-in:inbody
  10. <CENTER>
  11. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  12. <!--
  13. function password() {
  14. var testV = 1;
  15. var pass1 = prompt('Please Enter Your Password','');
  16. while (testV < 3) {
  17. if (!pass1) 
  18. history.go(-1);
  19. if (pass1 == "¤caption_object$(1)¤") {
  20. alert('You Got it Right!');
  21. window.open('¤url_object$(1)¤');
  22. break;
  23. testV+=1;
  24. var pass1 = 
  25. prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
  26. }
  27. if (pass1!="¤caption_object$(1)¤" & testV ==3)               
  28. history.go(-1);
  29. return " ";
  30. }
  31. document.write(password());
  32. // End -->
  33. </SCRIPT>
  34. <CENTER>
  35. <FORM>
  36. <input type="button" value="Enter Password Protected Area" onClick="password()">
  37. </FORM>
  38. </CENTER>
  39. _end-insert: