jjery验证与ajax无法正常工作

时间:2016-03-14 08:46:14

标签: javascript jquery ajax

$.validator.addMethod("check_voucher_number", function(value, element) {
    var inputElem = $('#input_form :input[name="voucher"]'),
        data = { "voucher" : inputElem.val() },
        eReport = ''; //error report

    $.ajax(
    {
        type: "POST",
        url: 'check_voucher_number.php',
        dataType: "json",
        data: data, 
        success: function(returnData)
        {
            return false;
           //return true
        }
    });
}, 'already taken');

当我在成功价值中返回真或假时,它总是返回'已经采取了'

0 个答案:

没有答案