validator-demo icon indicating copy to clipboard operation
validator-demo copied to clipboard

Selector

Open placeposition opened this issue 9 years ago • 1 comments

Can you add the original selector value? I want to do this:

$('input[type="email"]').mailgun_validator({ api_key: 'pubkey-XXXXXXXXXX', in_progress: function(){ console.log('MG Validating'); }, success: function(data){ if (!data.is_valid) { mailgunError($(this).selector, data); } else { mailgunSuccess($(this), data); } }, error: function(){
} });

placeposition avatar May 19 '15 13:05 placeposition

Take a look at my overhaul fork of this jquery plugin. It passes the original event object to the callbacks: https://github.com/msigley/validator-demo Using the event object you should be able to do this using the target property of the event.

msigley avatar Jun 03 '15 21:06 msigley