Mvc文本框与Bootstrap验证器

时间:2016-09-13 19:45:05

标签: c# asp.net asp.net-mvc twitter-bootstrap

我使用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'
                    }
                }
            }
        })

0 个答案:

没有答案