bootstrapValidator验证input的name属性有点怎么解决

镭射头 2015-09-17 11:26:22
代码如下:
$('#form1')
.bootstrapValidator({
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
cus.cname: {
message: 'The username is not valid',
validators: {
notEmpty: {
message: 'The username is required and can\'t be empty'
},
stringLength: {
min: 6,
max: 30,
message: 'The username must be more than 6 and less than 30 characters long'
},
/*remote: {
url: 'remote.php',
message: 'The username is not available'
},*/
regexp: {
regexp: /^[a-zA-Z0-9_\.]+$/,
message: 'The username can only consist of alphabetical, number, dot and underscore'
}
}
},



cus.cname: 这样写貌似不行啊,但是input的name属性确实又是cus.cname,大家有没有碰到过这种问题,点解。。
...全文
825 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
WMCQ 2018-08-28
  • 打赏
  • 举报
回复
'u.userName': {
message: 'The username is not valid',
validators: {
notEmpty: {
message: '请填写您的姓名'
},
stringLength: {
min: 6,
max: 20,
message: '长度应介于6到20位之间'
},
regexp: {
regexp: /^[a-zA-Z0-9_\.]+$/,
message: '输入格式不正确'
}
}
},


用单引号包起来
qq_29454727 2016-01-16
  • 打赏
  • 举报
回复
我也碰到了这样的问题,求解

39,087

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧