Same action, distinct result based on submit button

I’m trying to use EExcelView extension in a CGridView page. I created a form with several options, when the user press “Search” the CGridView gets updated via Ajax, using little modified Gii generated pages (_search.php and so on).

In the form page I’ve added a second submit:

<?php echo CHtml::submitButton(Yii::t('string','Scarica'), array('id'=>'excel','name'=>'excel')); ?>

then in the action:

if (isset($_REQUEST['excel'])) {

  $this->widget('ext.eexcelview.EExcelView', array(





the problem is that the form is not sending the submit button! Even debugging the request with firebug, the GET doesn’t include the submit button element!

I checked the generated html and it contains the input, into the form:


<div class="row buttons">

 <input type="submit" name="yt0" value="Cerca" />

 <input id="excel" name="excel" type="submit" value="Scarica" />	



This looks very strange.

If it’s not working, how can I detect which button has been pressed?