isleshocky77
01-14-2003, 01:08 AM
I tried doing this completely from JavaScript w/o html. We'll say for my purposes.. this is the way I need it done. Any suggestions how to declare the form w/o html <form> tags?
<html>
<script language="javascript">
function test() {
document.form[0].action="from.asp";
document.form[0].method="post";
document.form[0].name="Stephen";
document.form[0].age=17;
doucment.form[0].submit();
}
</script>
<a href="javascript:test();">Hello</a>
</html>
this returns the error:
Error: 'document.form.0' is null or not an object
<html>
<script language="javascript">
function test() {
document.form[0].action="from.asp";
document.form[0].method="post";
document.form[0].name="Stephen";
document.form[0].age=17;
doucment.form[0].submit();
}
</script>
<a href="javascript:test();">Hello</a>
</html>
this returns the error:
Error: 'document.form.0' is null or not an object