I have messed with this script for too long. When I click on the link or on the button, I get a message that says "Object does not support this property or method." According to all the debuggers I've tried (Microsoft and Netscape) the code always fails at 'frm.submit()' I have tried different script placements, in line scripts etc. all to no avail. The only time this seems to work is if I don't do any validation. The only problem is, I'm working the issue for an on line job application where validate is absolutely imperitive.
Any ideas?
Thanks in advance
Paul
<HTML>
<HEAD>
<SCRIPT LANGUAGE="javascript">
<!--//
function submitIt(frm){
if(validate(frm) doSubmit(frm)
}
function doSubmit(frm){
frm.submit()
}
function validate(frm){
if(isEmpty(frm.fname.value) || isEmpty(frm.lname.value)){
alert("Please fill out form completely."
return false;
}
return true;
}
function isEmpty(s){
if(s.length == 0 || s == ""{
return true;
}
}
//-->
</SCRIPT>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<!-- Border table -->
<FORM NAME="frmInput" METHOD="post" ACTION="output.asp">
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"> <TR>
<TD>
<!-- Interior table -->
<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 BGCOLOR="#BABABA">
<TR>
<TD>
<FONT FACE="verdana" SIZE=3>
First Name
</TD>
<TD>
<INPUT NAME="fname" TYPE="text">
</TD>
</TR>
<TR>
<TD>
<FONT FACE="verdana" SIZE=3>
Last Name
</TD>
<TD>
<INPUT NAME="lname" TYPE="text">
</TD>
</TR>
<TR>
<TD COLSPAN=2 ALIGN=right>
<FONT FACE="verdana" SIZE=3>
<A HREF="javascript:submitIt(document.frmInput)">
Submit</A>
<P>
<INPUT NAME="submit" TYPE="button" VALUE="Submit"
onClick="submitIt(document.frmInput)">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
Any ideas?
Thanks in advance
Paul
<HTML>
<HEAD>
<SCRIPT LANGUAGE="javascript">
<!--//
function submitIt(frm){
if(validate(frm) doSubmit(frm)
}
function doSubmit(frm){
frm.submit()
}
function validate(frm){
if(isEmpty(frm.fname.value) || isEmpty(frm.lname.value)){
alert("Please fill out form completely."
return false;
}
return true;
}
function isEmpty(s){
if(s.length == 0 || s == ""{
return true;
}
}
//-->
</SCRIPT>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<!-- Border table -->
<FORM NAME="frmInput" METHOD="post" ACTION="output.asp">
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"> <TR>
<TD>
<!-- Interior table -->
<TABLE BORDER=0 CELLPADDING=8 CELLSPACING=0 BGCOLOR="#BABABA">
<TR>
<TD>
<FONT FACE="verdana" SIZE=3>
First Name
</TD>
<TD>
<INPUT NAME="fname" TYPE="text">
</TD>
</TR>
<TR>
<TD>
<FONT FACE="verdana" SIZE=3>
Last Name
</TD>
<TD>
<INPUT NAME="lname" TYPE="text">
</TD>
</TR>
<TR>
<TD COLSPAN=2 ALIGN=right>
<FONT FACE="verdana" SIZE=3>
<A HREF="javascript:submitIt(document.frmInput)">
Submit</A>
<P>
<INPUT NAME="submit" TYPE="button" VALUE="Submit"
onClick="submitIt(document.frmInput)">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>