Reputation: 1
I have some input fields on which I trigger a ajax function on their change() event.
The problem is that I manually trigger this event in certain situations, so it gets executed quite a lot.
SO how can I run my ajax ONLY when the user has typed something in the input and moved his cursor away from it?
Upvotes: 0
Views: 55
Reputation: 78006
$('input').blur(function(){
alert('input has lost focus'); // do ajax call here...
});
Demo: http://jsfiddle.net/Yyygr/
Upvotes: 1