Skip to content

Instantly share code, notes, and snippets.

@ryanotella
Created December 1, 2016 04:47
Show Gist options
  • Select an option

  • Save ryanotella/57bd7b90d43385d4685f1e7da1e03f00 to your computer and use it in GitHub Desktop.

Select an option

Save ryanotella/57bd7b90d43385d4685f1e7da1e03f00 to your computer and use it in GitHub Desktop.
fdsfdssdfsd
$('[data-duplicate-check]').on('keyup change', '.email input', _.debounce(function () {
if($email.val().length < 3) {
return;
}
$.ajax({
url: '/web/api/checkout/duplicate/email',
data: {id: $('.email').attr('data-id'), email: $email.val()}
}).done(function (data) {
$email.parent().find('.alert-box').remove();
if (!$.isEmptyObject(data)) {
$email.after($('<p class="alert-box warning">').text(data.error));
} else {
$email.parent().find('.alert-box').remove();
}
});
}, 400));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment