I have a written a form with the built in functions of Yii which works great. The form can be submitted when the user selects any of the dropdown-fields. The data is posted with the GET-method and the values show up in the url as key in an array. The array has the same name as the model for the form.
ex. url/index.php?r=controller/action&Modelname[y-value]=1&Modelname[x-value]=2
The problem is that when I want to add a submit button that should submit some extra variables those variables are submitted the normal way, without being included in the model-array. This means that I can't change the parameters of the model but instead new values are sent. What I want is for the parameters defined in the button to be submitted into the model-array.
ex. url/index.php?r=controller/action&Modelname[y-value]=1&Modelname[x-value]=2&x-value=3
My code for the button is:
CHtml::submitButton('X-value',array('name'=>'x','params'=>array('x-value'=>3)));