form.submit

  • Revision slug: Talk:Document_Object_Model_(DOM)/form.submit
  • Revision title: form.submit
  • Revision id: 57064
  • Created:
  • Creator: Zzen
  • Is current revision? No
  • Comment question with event object posed

Revision Content

"* can "automatically" submit things this way without having to hit the submit button. ?But do you have to pass in the form parameters?"

You don't have to pass the form parameters. submit() will just submit whatever is currently in the form fields. You have to fill in the form fields using the "value" property programatically using JavaScript if you want to control what's passed.

Is there any way to cause the submit to auto-generate an event object and pass it to handler? Something like setTimeout( "window.getElementById('myForm').submit(e);" );. Thanks. Zzen 04:54, 12 October 2005 (PDT)

Revision Source

<dl><dd> "* can "automatically" submit things this way without having to hit the submit button. ?But do you have to pass in the form parameters?"
</dd></dl>
<p>You don't have to pass the form parameters. submit() will just submit whatever is currently in the form fields. You have to fill in the form fields using the "value" property programatically using JavaScript if you want to control what's passed.
</p><p>Is there any way to cause the submit to auto-generate an event object and pass it to handler? Something like
<code>setTimeout( "window.getElementById('myForm').submit(e);" );</code>. Thanks.
<a href="User:Zzen">Zzen</a> 04:54, 12 October 2005 (PDT)
</p>
Revert to this revision