Very simple non-critical password prompt where the password is equal to the page name (Stuff.htm):
<script language="javascript">
<!-- begin
function Enter() {
var location;
var password;
password=this.document.entryform.inputbox.value
location=password + ".htm"
fetch(location)
Stuff=window.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.open('','getStuff','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
root.location.href = location;
} else {
opener.location.href = location;
}
}
// end -->
</script>
It works fine except that if an incorrect password is entered it will look for a page name equal to the incorrect password. I would like to simply pop an alert ('Incorrect password') instead. Hope that made sense.
<script language="javascript">
<!-- begin
function Enter() {
var location;
var password;
password=this.document.entryform.inputbox.value
location=password + ".htm"
fetch(location)
Stuff=window.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.open('','getStuff','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
root.location.href = location;
} else {
opener.location.href = location;
}
}
// end -->
</script>
It works fine except that if an incorrect password is entered it will look for a page name equal to the incorrect password. I would like to simply pop an alert ('Incorrect password') instead. Hope that made sense.