use CJuiDialog to send a message - How to link to a controller action?

I want to implement this feature:

user click the button on the page, than a dialog box pop up(e.g. CJuiDialog). User can input the short messang, and click ‘send’ button on this dialog window.

After the click, the message will be sent to its destination (e.g.: saved in database). Dialog box closed. Please refer to the photo.

By digging into many examples, I come up with the following code:

To initialize a CJuidialog

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(



    	'title'=>'Joining A Firm',






    	'closeOnEscape'=> true,












	echo '<span>Message to this company</span><br/>';

	echo CHtml::textArea('message');  // this generate the textarea



To call the dialog:

  <?php echo CHtml::Button('Join this firm',                    	




I feel it likes MVC in a CJuiDialog, but couldn’t sort it out myself.

This is as far as I can go by myself. How to link the send button with a controller action? so that user message can be processed?

Thank you!