Rikmoncur, that works because the form's name is "form". It looks like he's trying to submit whatever form is called by the function. Say he has two forms on a page - a login form and a register form, and he wants to be able to call one function to submit either form, like this:
<script>
function submitform(formname)
{
document.formname.submit();
}
</script>
<form name="login"></form>
<form name="register></form>
<input value="login" onclick="submitform('login')">
<input value="register" onclick="submitform('register')">
The problem here is that JS thinks you're trying to submit a form named "formname". This is why I don't like JavaScript's way of handling variables - prefixing them like in PHP would help clear up a lot of things. I've been looking for a solution for this too, but no luck. But if anyone knows (finds) one, post it here.
I hope this post helped to explain to some of you what sh*t4brains is trying to do.