How change a mask with radioButton

Hello all, I had a 2 radioButtons and I want to change a mask if RadioButton changed…

 <?php echo $form->radioButtonList($model, 


    array('Type1' => 'Type1', 'Type2' => 'Type2'), 

    array('separator' => '     '); ?>


            $this->widget('CMaskedTextField', array(

                'model' => $model,

                'attribute' => 'attributeMask',

                'mask' => $model->maskSelected,

                'htmlOptions' => array('size' => 16, 'maxlength' => '14')



and on my controller I had

class UserForm extends CFormModel {

    public $typeMask= 'Type1';

    public $maskSelected= '999.999';

    public $attributeMask




So, how i can code to radioButton onChange run something on my form and change the maskSelected and re-render the maskText.

Starting now with Yii, sorry for newbie…


I have the same question:

I need to show/hide some fields depends on changed field value

Perhaps useless but anyway you have to put an onclick handler


$model, ‘MyRadioButton’,

array(1=> ‘1’, 2 => ‘2’, 3 => ‘3’),

array(’ display’ => ‘inline’, ‘onclick’ => ‘this.form.submit()’));

Nic the Frenchy