提交按钮在表单外的提交方式
作者:
zxk175 | 来源:发表于
2017-03-15 09:57 被阅读282次// 异步提交表单
$('#loan_add').ajaxForm(function (data) {
var json = JSON.parse(data);
if (json.code == 200) {
layer.msg(json.msg, {icon: 1, time: 1000});
//一秒后执行跳转
setTimeout(function () {
location.href = json.url;
}, 1000);
} else {
//提示错误信息
$('#tip').html(json.msg);
}
});
// 点击提交按钮事件
$("#submit").on("click", function () {
$('#loan_add').submit();
});
jQuery-Form插件GitHub地址:https://github.com/jquery-form/form
本文标题:提交按钮在表单外的提交方式
本文链接:https://www.haomeiwen.com/subject/frxlnttx.html
网友评论