MDN may have intermittent access issues April 18 13:00 - April 19 01:00 UTC. See whistlepig.mozilla.org for all notifications.

mozilla

Revision 57065 of form.submit

  • Revision slug: Talk:Document_Object_Model_(DOM)/form.submit
  • Revision title: form.submit
  • Revision id: 57065
  • Created:
  • Creator: Chealer
  • Is current revision? Yes
  • Comment add Comparison with form submit button; 59 words added

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)

 

Comparison with form submit button

I believe saying the submit method is equivalent to using a submit button in the form is inexact, even though the DOM specification says that. I mentioned this in http://lists.w3.org/Archives/Public/...nMar/0011.html

Chealer 2012-01-21

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" title="User:Zzen">Zzen</a> 04:54, 12 October 2005 (PDT)</p>
<p> </p>
<h2 id="Comparison_with_form_submit_button">Comparison with form submit button</h2>
<p>I believe saying the submit method is equivalent to using a submit button in the form is inexact, even though the DOM specification says that. I mentioned this in <a class=" external" href="http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0011.html" rel="freelink">http://lists.w3.org/Archives/Public/...nMar/0011.html</a></p>
<p>Chealer 2012-01-21</p>
Revert to this revision