PDA

View Full Version : need a little help please



gmilazzo
11-18-2005, 05:53 PM
Can some one tell me what i'm doing wrong because when you click on the submit button it goest to the page but don't pass the login info to the page.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" language="JavaScript">

function ActionDeterminator()
{
if(document.login.location[0].checked == true) {
document.login.action = 'http://69.90.113.202/Templates/Default/login.aspx';
}
if(document.login.location[1].checked == true) {
document.login.action = ' http://panel.greatlakegaming.net/Templates/Default/login.aspx ';
return true;
}
// -->
</script>

</head>

<body>
<form name="login" method="POST" action="">

<table border="0" align="center" id="table1">
<tr>
<td><strong>User:</strong></td>
<td><input type="text" name="USERID" size="20"></td>
</tr>
<tr>
<td height="27"><strong>Password</strong>:</td>
<td><input type="password" name="PASSWORD"
size="20"></td>
</tr>
<tr>
<td height="59" valign="top"><strong>Location:</strong></td>
<td valign="middle">
<input name="location" type="radio" checked>
Chicago<br> <input type="radio" name="location">
New York<br>
</td>
</tr>
</table> <p>&nbsp;</p>
<p align="center">
<input type="submit" value="Submit" name="B1"
onClick="return ActionDeterminator();">
<input type="reset" value="Reset"
name="B2">
</form>


</body>
</html>

BigBody
11-19-2005, 01:30 PM
function ActionDeterminator()
{
if(document.login.location[0].checked == true) {
document.login.action = 'http://69.90.113.202/Templates/Default/login.aspx';
}
if(document.login.location[1].checked == true) {
document.login.action = ' http://panel.greatlakegaming.net/Templates/Default/login.aspx ';}
return true;
}


Add a '}' as this code, that's allright !
Good luck!

Twey
11-19-2005, 02:15 PM
Also, one usually uses the form's onsubmit event, rather than the submit button's onclick event. This allows for other ways of submitting the form (e.g. pressing enter). In addition to this, you should really give an action in plain HTML first, for non-Javascript browsers.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function ActionDeterminator() {
document.forms['login'].action = document.forms['login'].elements['location'].value;
return true;
}
</script>
</head>
<body>
<form name="login" method="POST" action="http://69.90.113.202/Templates/Default/login.aspx" onsubmit="return ActionDeterminator();">
<table border="0" align="center" id="table1">
<tr>
<td><strong>User:</strong></td>
<td><input type="text" name="USERID" size="20"></td>
</tr>
<tr>
<td height="27"><strong>Password</strong>:</td>
<td><input type="password" name="PASSWORD" size="20"></td>
</tr>
<tr>
<td height="59" valign="top"><strong>Location:</strong></td>
<td valign="middle">
<input name="location" value="http://69.90.113.202/Templates/Default/login.aspx" type="radio" checked="true"/> Chicago<br>
<input type="radio" value="http://panel.greatlakegaming.net/Templates/Default/login.aspx" name="location"/>
New York<br>
</td>
</tr>
</table> <p>&nbsp;</p>
<p align="center">
<input type="submit" value="Submit" name="B1"/>
<input type="reset" value="Reset" name="B2"/>
</p>
</form>
</body>
</html>

gmilazzo
11-19-2005, 02:52 PM
thanks guys for the help