[JavaScript] submit() Doesn't Work When There's name="submit" Element in Form

Tadashi Shigeoka ·  Mon, January 20, 2014

In JavaScript, if there’s an element with name=“submit” inside a form, .submit() apparently doesn’t work.

So when I wrote the following in jQuery, I got the error Property ‘submit’ of object # is not a function.

When you place an element with the name “submit” inside a form tag, it seems to reference that element instead.

So,



Fixing it like this will work.


Reference Information

javascriptでsubmitできない? | dTblog | デザインとプログラムの境界をさまようブログ

[jQuery]form.submit()できない原因 | HappyQuality

javascript - Property ‘submit’ of object #<HTMLFormElement> is not a function - Stack Overflow

That’s all from the Gemba.