Last active
February 19, 2016 05:35
-
-
Save cergey-obr/89862bf0d47e1e6b54d6 to your computer and use it in GitHub Desktop.
Проверка капчи через ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod('isCorrectCaptcha', function(value, element, params){ | |
var is_valid = false; | |
$.ajax({ | |
url: '/udata/custom/isCorrectCaptcha/', | |
type: 'POST', | |
async: false, | |
data: { | |
captcha: value | |
}, | |
success: function(xml){ | |
is_valid = $(xml).find('udata').text() == 'correct' ? true : false; | |
} | |
}); | |
return is_valid; | |
}, 'Введите корректный код с картинки') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment