$.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');
当我在成功价值中返回真或假时,它总是返回'已经采取了'