我使用Bootstrap validator使用MVC而不使用任何模式,但文本框不接受特殊字符。
代码:
@Html.TextBoxFor(model => model.Line1, new { @class = "form-control", tabindex = 2})
验证码
.bootstrapValidator({
excluded: [':disabled'],
feedbackIcons: {
valid: 'glyphicon glyphicon-ok form-control-feedback',
invalid: 'glyphicon glyphicon-remove form-control-feedback',
validating: 'glyphicon glyphicon-refresh'
},
// live: 'enabled',
fields: {
Line1: {
validators: {
notEmpty: {
message: 'The field is required'
}
}
}
})