How to do dynamic form via ajax

I know there must be a way to do this cleanly in Yii.  I have a form with radio buttons. When one is selected and the select button clicked, I send an Ajax request to the controller.

That's where I'm lost. The choice of radio button determines which variety of form should replace the original form…a continuation. Outside of Yii, I would do an include of a file containing the next form based on the radio button, and just echo that include.  Here, however, the new form will have CHtml calls, and needs to be rendered, etc.  I could do the processing as a function in the controller, even with a select case… but then what?  I don't see how the normal form render can be replaced in such a way as to pass the form back in the ajax response.

Maybe i don’t get it, but what’s wrong with using renderPartial or renderFile with return-Parameter set to true? Afterwards you can do what ever you like with the rendered data and send it finally back…

No, it’s me who doesn’t get it  :)  I’m still getting my arms around the api.  Ok, so that makes sense, to render to a return instead of immediately. So in that case, and I apologize for a newbie question, I would take that form to be rendered conditionally, and I would move the form code from the view into the controller, render it in reponse to the ajax request, and return it. Is that right?