Alert does not stop appearing

1
$(document).ready(function(){
        formLaboralLoad();
        formLugarLaborado(null);
        formSaludLoad();
        segundaValidacion(); 
    });
    function segundaValidacion(){
        $('#erp_planillasbundle_solicitudemptype_dpi').blur(function(){
            if($(this).val().length != 13){
                alert("El dpi debe tener 13 caracteres");
                $('#guardar').hide();
              }else{
                validar_dpi();
            } 
        });
        $('#erp_planillasbundle_solicitudemptype_validDpi').bind("cut copy paste",function(e) {
            e.preventDefault();
        });    
        $('#erp_planillasbundle_solicitudemptype_validDpi').blur(function(){
            if ($(this).val() != $('#erp_planillasbundle_solicitudemptype_dpi').val()) {
                alert("El dpi no Coincide");
                $('#saveAll-btn').prop('disabled', true);
                $("#errorAlGuardar").html("<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span> El dpi no Coincide");
                $("#errorAlGuardar").show()              
            }else{
                $('#saveAll-btn').prop('disabled', false);
                $("#errorAlGuardar").hide();
            }
        });
    } 

I have the following function and the problem is that at the time of pressing tab in the first input the validation appears that the fields are not equal but it does not stop appearing again and again the alert

    
asked by oscarito77 31.05.2018 в 23:19
source

0 answers