using multiple radio button

Comparing #7 with #8

Revision #8 was created by Maurizio Domba Cerin Maurizio Domba Cerin on Mar 9, 2012, 9:37:59 AM.

fixed typo, styling, and removed link to the webpage

Content

wWhen we use multiple radio buttons with same name in Yii many people have the problem on getting the value of the selected radiobutton. we can usThe radioButtonList can be used for that. B, but if we need to use radioButton itself to place the button any where in a view.
 
 
, we need to have include one more parameter in htmloption array().

**'uncheckValue'=>null**
[...]
```php
echo CHtml::radioButton('btn',
 false, array(
 
    
'value'=>'1',
 
    
'name'=>'btnname',
 
    
'uncheckValue'=>null
 
)); CHtml::radioButton('btn', false, array(
 
    
'value'=>'2',
 
    
'name'=>'btnname',
 
    
'uncheckValue'=>null
 
)); //or we can use it in activeRadioButton()
 
 
, too echo $form->radioButton($model, 'name', array(
 
    
'value'=>1,
 
    
'uncheckValue'=>null
 
)); echo $form->radioButton($model, 'name', array(
 
    
'value'=>2,
 
    
'uncheckValue'=>null
 
)); ```
 
so we can place theany where ion athe page. regards **support@nintriva.com**
 
 
[Nintriva](http://www.nintriva.com)
nitriva