L
Lefty
I am trying to use a simple Login procedure with a form and a javascript
function on the same html page. The page works as intended on IE 6 and 7,
whereas FF2 and 3 claim that a variable (pwform) is not defined.
Can someone explain me how tofix it for FF2 and 3?
-------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Login page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript">
<!--
if(top.frames.length!=0){top.location=self.document.location;}
function logon(form){
var pw=form;
if (pw != null){
location.href= 'htm/' + pw + '.htm';
}
}
// -->
</script>
<style type="text/css">
body{background:#ffffff url(img/site/bg.gif) repeat;}
table{width:300px;height:200px;border:3px solid
#cccccc;font-size:large;color:#808080;background:#eaeaea;}
..center{text-align:center;}
</style>
</head>
<body><br /><br /><br />
<div class="center">
<table cellpadding="0" cellspacing="0" border="1">
<tr>
<td class="center">
<h2>Please enter password</h2>
<form name="pwform" action="javascript:logon(pwform.pw.value)">
<input type="password" name="pw" size="20" /><br /><br />
<input type="submit" value=" Login! " />
</form>
</td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
document.pwform.pw.focus();
// -->
</script>
</body>
</html>
-----------
function on the same html page. The page works as intended on IE 6 and 7,
whereas FF2 and 3 claim that a variable (pwform) is not defined.
Can someone explain me how tofix it for FF2 and 3?
-------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Login page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript">
<!--
if(top.frames.length!=0){top.location=self.document.location;}
function logon(form){
var pw=form;
if (pw != null){
location.href= 'htm/' + pw + '.htm';
}
}
// -->
</script>
<style type="text/css">
body{background:#ffffff url(img/site/bg.gif) repeat;}
table{width:300px;height:200px;border:3px solid
#cccccc;font-size:large;color:#808080;background:#eaeaea;}
..center{text-align:center;}
</style>
</head>
<body><br /><br /><br />
<div class="center">
<table cellpadding="0" cellspacing="0" border="1">
<tr>
<td class="center">
<h2>Please enter password</h2>
<form name="pwform" action="javascript:logon(pwform.pw.value)">
<input type="password" name="pw" size="20" /><br /><br />
<input type="submit" value=" Login! " />
</form>
</td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
document.pwform.pw.focus();
// -->
</script>
</body>
</html>
-----------