提交按钮在form之外的提交方式,提交按钮提交页面任意表单----来源于网络
代码
{dotted startColor="#ff6c6c" endColor="#1989fa"/}
结构
<form id="loginForm" action="{:url('Index/add')}" method="post" enctype="multipart/form-data">
<div>
... ...
</div>
</form>
<div>
<button type="button" onclick="tijiao();" class="btn btn-primary">提交</button>
</div>
js
function tijiao(){
document.getElementById("loginForm").submit();//js原生方式表单提交
$("#loginForm").submit();//或者jQuery方式,二选一,不过现在已经没啥项目不引入jQuery了吧。。。
}
{dotted startColor="#ff6c6c" endColor="#1989fa"/}
来源于 https://blog.csdn.net/zouzongning/article/details/80864994
©版权声明演示站内容均来自互联网,如有侵权,请与我联系
THE END
喜欢就支持以下吧
The God only arranges a happy ending. If it is not happy, it means it is not the final result.
上天只会安排快乐的结局,如果不快乐,说明还不是最终结局。
优雅的支付系统:给站长提供强劲的生产力
子比主题付费下载演示
超级耐看的小可爱美女图集
《超能陆战队》预告片
子比主题优雅的付费图库体验
新 iPad 测评:苹果在教育领域的野心