Twitter bootstrap 同一页面上的boostrap验证程序具有多个表单
我有一个页面,有两个表单“注册”类“sup”和“登录”类“si”, 我使用这些类创建boostrap模式:Twitter bootstrap 同一页面上的boostrap验证程序具有多个表单,twitter-bootstrap,validation,bootstrapvalidator,Twitter Bootstrap,Validation,Bootstrapvalidator,我有一个页面,有两个表单“注册”类“sup”和“登录”类“si”, 我使用这些类创建boostrap模式: $(".si").click(function (e) { e.preventDefault(); $(".si_section").show(); $(".sup").hide(); $(".modal-header h4 span").html("@Resources.SignIn"); }); 他们有一
$(".si").click(function (e) {
e.preventDefault();
$(".si_section").show();
$(".sup").hide();
$(".modal-header h4 span").html("@Resources.SignIn");
});
他们有一些共同的领域。用户名、密码
因此,我加载scipt来为每个scipt调用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'
}
}
}
}
})
但它不起作用,只有第一个是验证,我错了什么?我怎么做?谢谢我最终做了内联编辑器,因为在我的案例中,多表单有效性有一个问题