jQuery-iMask icon indicating copy to clipboard operation
jQuery-iMask copied to clipboard

jQuery events get lost

Open ghost opened this issue 13 years ago • 4 comments

When I attach iMask to an input field via it's ID or class I'm not able to catch any other jQuery events any more, like this:

form input type="text" id="test" class="validate-me" /form

$('.validate-me').iMask({ type: 'number', decDigits: 0, decSymbol: '', groupSymbol: '.' }); $('.validate-me').change( function() { alert('changed!') } );

does not fire the jQuery change event any more.

ghost avatar Jun 06 '12 12:06 ghost

Testing iMask and a slew of similar, this seemed by far the best. Until I hit this problem. It does appear to be a show-stopper (at least for my apps). I'm surprised that it has gone four months without even a comment.

Oh well, on to the next candidate.

jh-orange avatar Oct 07 '12 13:10 jh-orange

Yeah, thats really annoying. I have solved this however, by doing it this way:

$('.validate-me').live('blur', function() { alert('changed!') });

"blur" gets fired when the focus leaves the input field, which is what I wanted to achieve with the former "change". So it's working fine for me. Hope this is a useful information :)

ghost avatar Oct 07 '12 14:10 ghost

Thanks. I ended up with the same conclusion except I saved the previous value so I could, in effect, detect ‘change’ and just ignore otherwise. A little inconvenient but there was a lot of database activity involved in a change that I didn’t want happening on a simple “hello, just passing through” event.

From: hirschnase [mailto:[email protected]] Sent: Sunday, October 07, 2012 10:05 AM To: cwolves/jQuery-iMask Cc: jh-orange Subject: Re: [jQuery-iMask] jQuery events get lost (#3)

Yeah, thats really annoying. I have solved this however, by doing it this way:

$('.validate-me').live('blur', function() { alert('changed!') });

"blur" gets fired when the focus leaves the input field, which is what I wanted to achieve with the former "change". So it's working fine for me. Hope this is a useful information :)

— Reply to this email directly or view it on GitHub https://github.com/cwolves/jQuery-iMask/issues/3#issuecomment-9208257 .

https://github.com/notifications/beacon/J6T91GIPIyhU-8ti4GCGPyhSvb1r0P2Pd1mkMEJNqJYeHehhbsuBSqnyQ6sGPDSv.gif

jh-orange avatar Oct 15 '12 19:10 jh-orange

I have the same problem.

djalmaoliveira avatar Dec 05 '12 13:12 djalmaoliveira