Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bootstrap 3工具提示和表单字段上的jquery验证导致问题_Jquery_Html_Twitter Bootstrap 3_Tooltip_Jquery Validation Engine - Fatal编程技术网

Bootstrap 3工具提示和表单字段上的jquery验证导致问题

Bootstrap 3工具提示和表单字段上的jquery验证导致问题,jquery,html,twitter-bootstrap-3,tooltip,jquery-validation-engine,Jquery,Html,Twitter Bootstrap 3,Tooltip,Jquery Validation Engine,在您的帮助下,我一直在使用带有自定义规则的jquery验证。但是,我现在尝试将工具提示添加到表单字段中,但没有验证。错误没有显示在工具提示中 当我刚刚完成验证时,消息被正确地添加和删除。但是,当我向表单字段添加工具提示时,即使在您满足验证规则之后,文本错误p标记仍然保留 验证规则 向字段添加工具提示 将验证添加到字段中 字段的HTML jQuery.validator.addMethod("a2format", function (val, el, params) { var a2che

在您的帮助下,我一直在使用带有自定义规则的jquery验证。但是,我现在尝试将工具提示添加到表单字段中,但没有验证。错误没有显示在工具提示中

当我刚刚完成验证时,消息被正确地添加和删除。但是,当我向表单字段添加工具提示时,即使在您满足验证规则之后,文本错误p标记仍然保留

验证规则

向字段添加工具提示

将验证添加到字段中

字段的HTML

jQuery.validator.addMethod("a2format", function (val, el, params) {
    var a2check = true;
    var a2size = $("#alias2").val().length;
    if (a2size == 0) {
        a2check = true;
    } else if (val.charAt(0) == "2" ) {
        a2check = true;
    } else {
        a2check = false;
    }
    return a2check;
},"Your dial in code needs to start with  the number 2.");
$('input[id=alias2]').tooltip({'trigger':'focus', 'placement': 'top', 'title': 'To set up a Custom Dial In Code please start with a 2'});
$("#alias1, #alias2").change(function() {
    var aliasChk = jQuery.extend(validationPluginDefaults, {
        rules: {
            alias1:{
                validateAlias: true,
                aliasFormat: true
            },
            alias2:{
                a2format: true
            }
        }
    });

    $("#mtg_form").validate(aliasChk);

    if ($("#mtg_form").valid()) {
        $("#updateMtg_btn").prop("disabled", false);        
    } else {
        $("#updateMtg_btn").prop("disabled", true);
    }   
});
<div>   
    <label class="mtgFormLabel" for="alias2" id="alias2Label">Custom Dial In Code <span class="grayText smallText">(optional)</span>:</label> 
    <input type="text" class="noResize form-control input-md" id="alias2" name="alias2" maxlength="300" style="width: 98%" placeholder="Please enter a numeric value">              
</div>