Ajax calling for textfield in YII 1

Anyone Please help me!!

I am a YII 1.14 Developer. Presently I am facing a problem, My requirement is

In the entry screen based on a input given in certain fields say UID or SSN or vehicle number (which are unique) the backend query or webservice is to be executed by giving the input value in query and fetch the required details and should be popped out in the entry screen in the respective fields which avoid data entry mistakes and typing burden.

Similarly Whenever a application number (or) any unique field value given the query to executed and to be checked whether the record already exists in the database or not and should populate a dialog box showing it is duplicate record entry for the application if it already exists in database.

Please help me, These to be done in 3 days. Please suggest me any reference links or any solution. I have done ajax calling for dropdown but unable to know about for lost focus event of a textbox. Please help me

Thanks in advance