我有一个包含2个表格的页面"注册" class" sup"和"登录" class" si", 我使用这些类创建了boostrap模式:
$(".si").click(function (e) {
e.preventDefault();
$(".si_section").show();
$(".sup").hide();
$(".modal-header h4 span").html("@Resources.SignIn");
});
他们有一些共同的领域。用户名,密码......
所以我加载scipts为每个scipts调用bootstrapvalidator:
$('#form-login').bootstrapValidator({
framework: 'bootstrap',
feedbackIcons: {
//valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
use_email: {
validators: {
notEmpty: {
message: '@Resources.required'
},
emailAddress: {
message: '@Resources.loginfailuremessage'
}
}
},
use_password: {
validators: {
notEmpty: {
message: '@Resources.required'
}
}
}
}
});
// Form validator for registration
$('form-registration').bootstrapValidator({
framework: 'bootstrap',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
use_email: {
validators: {
notEmpty: {
message: '@Resources.required'
},
emailAddress: {
message: '@Resources.loginfailuremessage'
}
}
},
Password: {
validators: {
notEmpty: {
message: '@Resources.required'
},
emailAddress: {
message: '@Resources.loginfailuremessage'
}
}
}
}
})
但它没有'工作,只有第一个是验证,什么'我的错误?我该怎么做 ?感谢
答案 0 :(得分:0)
我最终使用内联编辑器,因为多个表单验证在我的案例中存在问题