开发者

How do you submit a form with javascript with a <input type="button">

开发者 https://www.devze.com 2022-12-29 05:08 出处:网络
How wou开发者_运维百科ld you use a div to submit a form, for example? Javascript pleaseLike this:

How wou开发者_运维百科ld you use a div to submit a form, for example? Javascript please


Like this:

document.getElementById("ID of form element").submit()


I have an onchange event attached to a dropdown that does:

this.form.submit();

It's used on an internal utility, so I'm not sure if there is a cross-browser issue, but it's great on IE 7, firefox 3.x, and safari.

0

精彩评论

暂无评论...
验证码 换一张
取 消