Click to See Complete Forum and Search --> : mcfedries security script resulting in bug


puppi
11-01-2003, 04:32 PM
This script for simple security, from CGI Creating a Webpage, is resulting in an error: opener.location,href+ loc not an object.

Here is the script:
<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>

Anybody see how to fix this? Thanks.

AdamGundry
11-02-2003, 03:10 AM
Is this script running in a popup window? If not, it won't work.

By the way, to comply with accessibility requirements your pages should work without the use of Javascript/popups.

Adam