我有一个包含 2 个表单“注册”类“sup”和“登录”类“si”的页面,我使用这些类来创建 boostrap 模式:
$(".si").click(function (e) {
e.preventDefault();
$(".si_section").show();
$(".sup").hide();
$(".modal-header h4 span").html("@Resources.SignIn");
});
他们有一些共同的领域。用户名密码...
所以我加载了 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'
}
}
}
}
})
但它不起作用,只有第一个是验证,我的错误是什么?我该怎么做 ?谢谢