I have been using this simple, yet elegant, script for many years and it has suddenly stopped functioning! Does anyone understand why? It is for simple protection of multiple pages from casual users.
<script language="JavaScript" TYPE="text/javascript">
<!--
function SubmitPassword(frm)
{
//
// Get the value entered into the text box
//
var password = frm.pw.value
//
//Convert it to lower case
//
password = password.toLowerCase()
//
//Add the .htm extension
//
var loc=password + ".htm"
//
// make sure the user entered something
//
if (password != "")
{
//
// If so, send the browser there
//
opener.location.href=loc
}
//
//Close this window
//
window.close()
}
// -->
</script>
This script should take the password, add .htm and send the user to that protected page. Instead, it is returning the user to the previous page from which they reached the jspass input page.
Ok, then it sounds like the window.close() line is being triggered(presumably what brings the user to the "previous page" as you said).
try putting this just inside your function and see what it displays:
Code:
alert(frm.pw.value);
If nothing then you'll need to check that you are getting the value of the right form element. I can't check that as you have not supplied the relevant code.
Bookmarks