cancel
Showing results for 
Search instead for 
Did you mean: 

$.validator.addMethod AJAX CALL

$.validator.addMethod AJAX CALL

Hello,

I want to make an Ajax call to check a value. I made this an it's work, but the script run and don't wait call's result...

I' dont see how to process to waiting the result of my call and return false or true

 

$.validator.addMethod(
    "callAjax",
    function(value, element) {

        $.ajax({
            method: "POST",
            url: myURL,
            data: {
                myData: myData
            },
            dataType: "json"
        })
        .fail(function() {
            return false
        })
        .done(function() {
            return true
        })

    }, "Error"

);

Any idea?

thank a lot Smiley Happy

1 REPLY 1

Re: $.validator.addMethod AJAX CALL

ni idea? Smiley Happy