I’m trying to create a pop up box that asks for a password but I can’t seem to get it to work. I’ve got this
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "password") {
window.open('/resources_admin');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Sorry you don't have access to this page','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
With the button looking like this
<a class="btn btn-restricted" id="passWord">Protected Access</a>
I’ve not getting any errors at all but the popup isn’t working either. I’ve checked and popups isn’t disabled either.