Bootstrap 自动完成 Safari 浏览器验证失败

Bootstrap validation failing for autocomplete safari browser

我正在使用 bootstrap 验证程序进行表单验证。我遇到了 Safari 浏览器自动完成的问题。

$('#registration_info_form').bootstrapValidator({
    message: 'This value is not valid',
    feedbackIcons: {
        valid: 'glyphicon glyphicon-ok',
        invalid: 'glyphicon glyphicon-remove',
        validating: 'glyphicon glyphicon-refresh'
    },
    verbose: false,
    fields: {
        Name: {
            message: 'Invalid format.',
            validators: {
                notEmpty: {
                    message: 'This field is required.'
                },
                stringLength: {
                    min: 2,
                    max: 100,
                    message: 'Name should be between 2 and 100 characters.',
                }
            }
        },
    }
});

我遇到了 Mac chrome 浏览器的问题。为了解决这个问题,我添加了以下解决 chrome 问题的代码。

$("#Name").change(function () {
    $('#registration_info_form').bootstrapValidator('revalidateField', 'Name');
});

但是,现在我面临 Mac Safari 浏览器的问题。任何帮助表示赞赏。提前致谢。

我找到了解决方案:)

我用过模糊事件。在模糊事件中,我再次验证相同的字段。

$("#Name").blur(function () {
    $('#registration_info_form').bootstrapValidator('revalidateField', 'Name');
});