Sohel Rana
Sohel Rana

Reputation: 191

focusout event get called multiple time. Why?

I have two view one Normal view and another partial view. I have a input field (PersonId) in that partial view (focusout event is in this field). And the partial view will be loaded when there is a change in master view input field (InvestigationId).

My problem is- when the page being loaded first time(partial view also loaded first time) for this the focusout event works perfectly.but when i changed "InvestigationId" 2nd time or 3rd time or more, the foucsout event get called similar times when the event get fired (PersonId focusout). My jquery code.

$(document).on('focusout','#PersonId',getPersonDetails); 

Upvotes: 1

Views: 1134

Answers (1)

Rohit Sharma
Rohit Sharma

Reputation: 3334

May solve your problem..! Not sure.

$(document).on('focusout','#PersonId', function(){
    //your code here
    //at the very end of your code just add
    return false;
});

Upvotes: 1

Related Questions