warkem
10-10-2003, 08:51 AM
Hi,
Keep getting an error on this page,
"Char: 1
Error: Object Expected
Code: 0"
Have no idea why? All the script does is validate the form, I had it working before on another page modified it and now it doesnt work, not even the hello world function??? Here is the code, followed by the function calls:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>AAESS EBP</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
//---------------------------------------------------------------
// SCRIPT
//---------------------------------------------------------------
<SCRIPT language="Javascript">
function showAlert()
{
alert("Hello world!");
}
function resetForm()
{
document.join.reset();
}
//Form Validation
function ValidateSelect()
{
int flag = 0;
//Check for Login
if (document.join.user_id.value == "")
{
alert("Please Enter a Login name.");
document.join.user_id.focus();
return false;
}
//Check for same password entered twice
else if (document.join.password.value != document.join.repassword.value)
{
alert("Please Enter the SAME password twice.");
document.join.repassword.focus();
return false;
}
//Check for password
else if (document.join.password.value == "")
{
alert("Please Enter a password.");
document.join.password.focus();
return false;
}
//Check for re-password
else if (document.join.repassword.value == "")
{
alert("Please retype your password here.");
document.join.repassword.focus();
return false;
}
//Check for Name
else if (document.join.first_name.value == "")
{
alert("Please Enter your first name.");
document.join.first_name.focus();
return false;
}
//Check for Last Name
else if (document.join.last_name.value == "")
{
alert("Please Enter your last name.");
document.join.last_name.focus();
return false;
}
//Check for address
else if (document.join.address.value == "")
{
alert("Please Enter your address.");
document.join.address.focus();
return false;
}
//Check for E-mail
else if (document.join.email.value == "")
{
if (flag != 0)
{
alert("Don't have one?");
alert("Get one!");
alert("Dumbass!");
alert("I mean really who doesn't have an e-mail address???");
document.join.email.focus();
return false;
}
else
{
flag = flag++;
alert("Please Enter you E-Mail address.");
document.join.email.focus();
return false;
}
}
//postcode check
else if (document.join.postcode.value == "")
{
alert("Please Enter your postcode.");
document.join.postcode.focus();
return false;
}
}
</SCRIPT>
<LINK href="aaess.css" type=text/css rel=stylesheet>
<link rel="stylesheet" href="forms.css" type="text/css">
</HEAD>
<BODY leftMargin=0 topMargin=0
onload="MM_preloadImages('images/home_on.gif','images/about_on.gif','images/login_on.gif','images/join_on.gif','images/news_on.gif')"
marginheight="0" marginwidth="0">
//---------------------------------------------------------------
// FUNCTION CALLS
//---------------------------------------------------------------
<form name="join" action="./v3/join.php" method="post" onSubmit="return ValidateSelect(this)">
<p> </p><table cellspacing=0 cellpadding=0 width=400 border=0 align="center">
<tbody>
<tr bgcolor=#009966>
<td colspan=3 height=5><img height=1 src="Join_files/spacer.gif"
width=1></td>
</tr>
<tr bgcolor=#ccffcc>
<td colspan=3 height=10>
<div align=right></div>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Login:</font></div>
</td>
<td width=20><img height=1 src="Join_files/spacer.gif" width=1></td>
<td>
<input maxlength=12 size=15 name=user_id class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Password:</font></div>
</td>
<td> </td>
<td>
<input maxlength=12 size=15 name=password type="password" class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Re-type password:</font></div>
</td>
<td> </td>
<td>
<input maxlength=12 size=15 name=repassword type="password" class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td colspan=2> </td>
<td> </td>
</tr>
<tr bgcolor=#ff9900>
<td bgcolor=#ff9900 colspan=2 height=40> </td>
<td>
<input type=submit value=Submit name=Submit class="submit">
<input type="reset" name="Submit2" value="Reset" onClick="resetForm()">
</td>
</tr>
</tbody>
</table>
</form>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV></TD></TR>
<TR bgColor=#009966>
<TD colSpan=2 height=20>
<DIV align=center><FONT face="Verdana, Arial, Helvetica, sans-serif"
color=#ffffff size=1>2003 © CSCI321 Project. Group: cs321a42</FONT></DIV>
</TD></TR></TBODY></TABLE>
<input type=submit value=Test name=Submit onclick="showAlert();return false">
</BODY></HTML>
Keep getting an error on this page,
"Char: 1
Error: Object Expected
Code: 0"
Have no idea why? All the script does is validate the form, I had it working before on another page modified it and now it doesnt work, not even the hello world function??? Here is the code, followed by the function calls:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>AAESS EBP</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
//---------------------------------------------------------------
// SCRIPT
//---------------------------------------------------------------
<SCRIPT language="Javascript">
function showAlert()
{
alert("Hello world!");
}
function resetForm()
{
document.join.reset();
}
//Form Validation
function ValidateSelect()
{
int flag = 0;
//Check for Login
if (document.join.user_id.value == "")
{
alert("Please Enter a Login name.");
document.join.user_id.focus();
return false;
}
//Check for same password entered twice
else if (document.join.password.value != document.join.repassword.value)
{
alert("Please Enter the SAME password twice.");
document.join.repassword.focus();
return false;
}
//Check for password
else if (document.join.password.value == "")
{
alert("Please Enter a password.");
document.join.password.focus();
return false;
}
//Check for re-password
else if (document.join.repassword.value == "")
{
alert("Please retype your password here.");
document.join.repassword.focus();
return false;
}
//Check for Name
else if (document.join.first_name.value == "")
{
alert("Please Enter your first name.");
document.join.first_name.focus();
return false;
}
//Check for Last Name
else if (document.join.last_name.value == "")
{
alert("Please Enter your last name.");
document.join.last_name.focus();
return false;
}
//Check for address
else if (document.join.address.value == "")
{
alert("Please Enter your address.");
document.join.address.focus();
return false;
}
//Check for E-mail
else if (document.join.email.value == "")
{
if (flag != 0)
{
alert("Don't have one?");
alert("Get one!");
alert("Dumbass!");
alert("I mean really who doesn't have an e-mail address???");
document.join.email.focus();
return false;
}
else
{
flag = flag++;
alert("Please Enter you E-Mail address.");
document.join.email.focus();
return false;
}
}
//postcode check
else if (document.join.postcode.value == "")
{
alert("Please Enter your postcode.");
document.join.postcode.focus();
return false;
}
}
</SCRIPT>
<LINK href="aaess.css" type=text/css rel=stylesheet>
<link rel="stylesheet" href="forms.css" type="text/css">
</HEAD>
<BODY leftMargin=0 topMargin=0
onload="MM_preloadImages('images/home_on.gif','images/about_on.gif','images/login_on.gif','images/join_on.gif','images/news_on.gif')"
marginheight="0" marginwidth="0">
//---------------------------------------------------------------
// FUNCTION CALLS
//---------------------------------------------------------------
<form name="join" action="./v3/join.php" method="post" onSubmit="return ValidateSelect(this)">
<p> </p><table cellspacing=0 cellpadding=0 width=400 border=0 align="center">
<tbody>
<tr bgcolor=#009966>
<td colspan=3 height=5><img height=1 src="Join_files/spacer.gif"
width=1></td>
</tr>
<tr bgcolor=#ccffcc>
<td colspan=3 height=10>
<div align=right></div>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Login:</font></div>
</td>
<td width=20><img height=1 src="Join_files/spacer.gif" width=1></td>
<td>
<input maxlength=12 size=15 name=user_id class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Password:</font></div>
</td>
<td> </td>
<td>
<input maxlength=12 size=15 name=password type="password" class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td height=30>
<div align=right><font face="Verdana, Arial, Helvetica, sans-serif"
color=#333333 size=1>Re-type password:</font></div>
</td>
<td> </td>
<td>
<input maxlength=12 size=15 name=repassword type="password" class=text>
</td>
</tr>
<tr bgcolor=#ccffcc>
<td colspan=2> </td>
<td> </td>
</tr>
<tr bgcolor=#ff9900>
<td bgcolor=#ff9900 colspan=2 height=40> </td>
<td>
<input type=submit value=Submit name=Submit class="submit">
<input type="reset" name="Submit2" value="Reset" onClick="resetForm()">
</td>
</tr>
</tbody>
</table>
</form>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV></TD></TR>
<TR bgColor=#009966>
<TD colSpan=2 height=20>
<DIV align=center><FONT face="Verdana, Arial, Helvetica, sans-serif"
color=#ffffff size=1>2003 © CSCI321 Project. Group: cs321a42</FONT></DIV>
</TD></TR></TBODY></TABLE>
<input type=submit value=Test name=Submit onclick="showAlert();return false">
</BODY></HTML>