mailgun / validator-demo

Mailgun email address jquery validation plugin http://mailgun.github.io/validator-demo/
Apache License 2.0
257 stars 80 forks source link

Selector #5

Open placeposition opened 9 years ago

placeposition commented 9 years ago

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(){
} });

msigley commented 9 years ago

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.