One Form, Two Submitbutton

I have one form, and would like to put two submitButton there, one is search, the other is export(to save the search result in a file).

Here is my code, search button works fine. For the export button, I would like to pass the search result to the function export in controller. How could I achieve this? Thanks a lot.

<?php $form=$this->beginWidget(‘CActiveForm’, array(



)); ?>



&lt;div class=&quot;row buttons&quot;&gt;

        &lt;?php echo CHtml::submitButton('Search'); ?&gt;


        &lt;?php echo CHtml::submitButton('Export',array('params'=&gt;array('model'=&gt;&#036;model,),'submit'=&gt;'glncrna/export')); ?&gt;


<!-- new code end -->

<?php $this->endWidget(); ?>

Can you do something like call the same action on controller for both search and export and check if it is search submit or export submit. In case of export submit, you do what you have to do in search as well and then write the result to file. Did you try something like this?