form 表单外面元素提交表单的方法:
html 代码:
<form id="loginForm" action="{:url('Public/login')}" method="post"> <div> ...... </div> </form> <div> <button type="button" class="btn btn-primary">提交</button> </div>
JQuery 代码:
$(document).ready(function(){ $('.btn').on("click",function(){ $("#loginForm").submit(); }) });
本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ 一张纸上写着一个字是什么成语?08/23
- ♥ Mac 下编译安装 PHP7 时报错:configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>的解决办法08/28
- ♥ Composer 提示:Installation failed, reverting ./composer.json to its original content.错误的解决办法07/06
- ♥ JQuery 动态修改 onclick 函数的参数值08/27
- ♥ Linux 下端口被占用的解决办法08/29
- ♥ 【疯狂猜成语/图猜成语】两个拳击手一个预备一个起是什么成语?08/22
内容反馈