$('#').formValidation校验网址
$('#addCarouselInfoForm').formValidation({
message: '格式不正确',
//不忽略隐藏域验证
excluded: [],
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
//图片上传验证
"fileId" : {
trigger:"change",
validators : {
notEmpty : {
message : '请上传图片'
}
}
},
intro: {
row: '.col-sm-9',
validators: {
notEmpty: {
message: '图片简介名称不能为空'
},
stringLength: {
min: 1,
max: 32,
message: '您已超出最大输入限制'
}
}
},
link: {
row: '.col-sm-9',
validators: {
notEmpty: {
message: '链接不能为空'
},
regexp: {
message: '请输入正确的链接地址',
regexp: /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,
}
}
},
sort: {
row: '.col-sm-9',
validators: {
notEmpty: {
message: '序号不能为空'
},
stringLength: {
min: 1,
max: 6,
message: '您已超出最大输入限制'
}
}
}
}
}).on('success.form.fv', function(e) {
e.preventDefault();
var $form = $(e.target);
var bv = $form.data('formValidation');
$.post($form.attr('action'), $form.serialize(), function(result) {
if(result.data==true){
//提交成功后回调函数
bt_alert('提示','添加成功');
window.location.href='';
}else{
bt_alert ('提示','添加失败');
}
}, 'json');
});
随机推荐
- Django扩展Auth-User表的几种方法
方式1, OneToOneField from django.contrib.auth.models import Userclass UserProfile(models.Model): user ...
- (字符串)count and say
https://www.nowcoder.com/practice/c5e8e84b62bb48398ec3c88153950fb5?tpId=46&tqId=29141&tPage= ...
- [转]VisualSVN错误 Cannot query proxy blanket解决办法
最近重新做了一下系统,在安装和使用svn过程中遇到了一些问题,记下备忘. 第一次安装好系统之后,安装VisualSVN遇到报错: Custom action InstallWMISchemaExcut ...
- Dapper相关了解
公司新项目用的是Dapper,做的时候没有具体看dapper的具体用法,现在回来回顾总结一下. 1-总体介绍dapper 我们都知道ORM全称叫做Object Relationship Mapper, ...
- Win7共享问题 映射网盘时出现的错误 the specified server cannot perform the requested operation
Win7共享问题 映射网盘时出现的错误:the specified server cannot perform the requested operation 解决方案: 1.重启电脑: 2.修改注册 ...
- Python中logging模块的基本用法
在 PyCon 2018 上,Mario Corchero 介绍了在开发过程中如何更方便轻松地记录日志的流程. 整个演讲的内容包括: 为什么日志记录非常重要 日志记录的流程是怎样的 怎样来进行日志记录 ...
- (转)ios学习--你会遇到的runtime面试题(详)
1.了解runtime吗?是什么? 2.你怎么知道的? 3.对象如何找到对应方法去调用的 于是我总结了很多网上被问到的一些关于runtime的题目,并做了详细的回答,并在后面补充了我在学习runtim ...
- 打谷机 BZOJ 1603 模拟
Farmer John有一个过时的打谷机(收割小麦),它需要带子来带动.发动机驱动轮1总是顺时针旋转的,用来带动转轮2,转轮2来带动转轮3,等等.一共有n(2<=n<=1000)个转轮(n ...
- CF352B Jeff and Periods 模拟
One day Jeff got hold of an integer sequence a1, a2, ..., an of length n. The boy immediately decide ...
- idea 新建maven项目没有src及其子目录问题
注意在这一步中,填写maven的本地地址还有手动修改settings地址非常重要!!! 如果你是第一次配置maven,少配置任何一个将导致你以后建立的mvn项目全部没有src目录!!! 解决办法就是卸 ...