Reputation: 5957
I've an input field I need to validate before sending the form.
So I bind a keyup event on this field, it send a XmlHttpRequest, and then I show the result on my ihm. It works fine.
But modern browsers provide some other way to add information into an input fields:
I tried various event to detect them, but no one's (keyup exepted of course) were triggered.
$('#theForm').on('keyup', '.url', checkUrl);
$('#theForm').on('changes', '.url', checkUrl);
$('#theForm').on('click', '.url', checkUrl);
Is it possible to detect these events?
My target browser is Firefox 17.
Upvotes: 0
Views: 55
Reputation: 7446
You can detect that event by using the input
event:
$('#theForm').on('input', '.url', checkUrl);
fiddle to test: http://jsfiddle.net/t8exjuq2/
Clicking that:
(submit the input of the fiddle once to get a tooltip)
Edit :: Tested in firefox 22.0 and chrome
Also, please note that the change
event will listen to almost everything but this.
Final edit ::
About the paste
, you can detect that event by using.... paste
:
$('#theForm').on('paste', '.url', checkUrl);
Upvotes: 1