Validation Error Message won't hide when valid

后端 未结 2 758
情深已故
情深已故 2021-01-19 00:13

UPDATE 2: I figured out that the title of the input was for some reason being displayed as an error message, I used ignoreTitle: tru

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 00:38

    just comment the errorplacement option and it will work as required.

    $(".guestlist-form").validate({
         ignoreTitle: true,
         errorClass: "error-class",
         validClass: "valid-class",  
    
         rules: {
            emailaddress: {
                required: true,
                email: "Please enter your correct email address."
            }
        },
        /*errorPlacement: function(error, element) {
            $(".myerror").html('');  // clears previous error messages
            error.appendTo( ".myerror");
        },*/
    
    
    
        messages: {
                     emailaddress: {
                     required: "Please enter your full email address."          
                    }
    
        }
    
    });
    

    Updated fiddle - http://jsfiddle.net/psbq8vkj/11/

提交回复
热议问题