Yii way of AJAX request, checking if username exists

Hey is there an example how to code a check when a user leaves a text field. To check if the user name is in use?

Not when pressed the submit button…

You will need to validate the textbox via ajax.

Write an 'onclick' event handler for the textbox which should submit the input value to server and collect the server side validation result to display.

There is no yii way to do this? ;-(