How does the failure to validate with jquery validation stay in the modal box?

function validform() {
    return $("-sharpreset_passwd").validate({
     rules: {
     password: {
            required: true,
            minlength: 6
          },
     confirm_password: {
            required: true,
            minlength: 6,
            equalTo: "-sharppassword"
          }
       },              
    });
}
$(validform());
$("-sharpssss").click(function() {    
    if (validform().form()) {
        $.ajax({
            type : "POST",
            url : "users",
            data : $("-sharpreset_passwd").serialize(),
            success : function(msg) {
                alert(1)
            },
            error : function(mes) {
                alert(2)
            }
        });
    } else {
    }
});
Jan.30,2022

does not seem to be used in this way; Sir, it becomes a rule, and then validates


problem is solved, and the validated form is bound to the confirm button

.
Menu