google chrome submits form even if there is no SUBMIT button

淺唱寂寞╮ 提交于 2019-12-01 04:48:25

To cite section 4.10.21.2 of the HTML5 specification:

"If the form has no submit button, then the implicit submission mechanism must just submit the form element from the form element itself."the form element itself."

Therefore I believe Chrome's behaviour to be correct, although I think other browsers do this as well. You can catch/block/process form submission by listening to the "submit" (e.g. to block it) event.BlockquoteBlockquotethe form element itself."

Not even Chrome, most of browsers submit once you press enter (even there is not submit button) when cursor in input.

I have the opposite problem. I use custom js-element for my form and when i use style='dispay:none;' for the submit button, chrome does not submit form on enter, although, firefox does :(

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!