baran
09-01-2003, 05:18 PM
this shouldn't be too hard for someone to solve. any help enormously appreciated. this little bug is causing me sleepless nights.
I have the javascript below. It is supposed to write a table in the second form on the page when the checkbox is clicked. but when I click the checkbox I get an 'object expected on line 5 Char 1' error. given how simple the form is I imagine its something an experienced programmer could spot easily...
here's the code:
<html>
<script type="text/javascript">
function writeclientdetailtable()
{
with (document.formTwo) {
writeln('<table cellspacing=15>');
writeln('<tr><td>File Number<BR><input type=textbox name="filenumber"></td>');
writeln('<td>First Name of Client<BR><input type=textbox name="clientonefirstname"></td>');
writeln('<td>Last Name of Client<BR><input type=textbox name="clientonelastname"></td>');
writeln('<tr><td> <BR><INPUT TYPE="submit" VALUE="Add New Record"></td>');
writeln('</TABLE>');
}
}
</script>
<form name="formOne">
<input type="submit" value="decoy">
</form>
<form name="formTwo">
Show client's details etc. <input type="checkbox" name="tickboxtoreplace" onClick="writeclientdetailtable(this.form)">
</form>
</html>
the form that is written by the function isn't complete yet but the code serves the purpose of illustrating my problem.
Thanks to anyone with any suggestions.
I have the javascript below. It is supposed to write a table in the second form on the page when the checkbox is clicked. but when I click the checkbox I get an 'object expected on line 5 Char 1' error. given how simple the form is I imagine its something an experienced programmer could spot easily...
here's the code:
<html>
<script type="text/javascript">
function writeclientdetailtable()
{
with (document.formTwo) {
writeln('<table cellspacing=15>');
writeln('<tr><td>File Number<BR><input type=textbox name="filenumber"></td>');
writeln('<td>First Name of Client<BR><input type=textbox name="clientonefirstname"></td>');
writeln('<td>Last Name of Client<BR><input type=textbox name="clientonelastname"></td>');
writeln('<tr><td> <BR><INPUT TYPE="submit" VALUE="Add New Record"></td>');
writeln('</TABLE>');
}
}
</script>
<form name="formOne">
<input type="submit" value="decoy">
</form>
<form name="formTwo">
Show client's details etc. <input type="checkbox" name="tickboxtoreplace" onClick="writeclientdetailtable(this.form)">
</form>
</html>
the form that is written by the function isn't complete yet but the code serves the purpose of illustrating my problem.
Thanks to anyone with any suggestions.