Yii Radio Button Tutorials

CHtml Radio Button List

Using CHtml class we are creating radioButtonList in yii framework. This post will help you to understand about how to create radioButtonList in different method, How to assign value, how to get radioButtonList value in controller, radioButtonList value from database, radioButtonList validation in model and radion button list style in yii framework.radioButtonListradioButtonList Validation In ModelradioButtonList Value In ControllerSelected radiobutton List Value From Databaseradiobutton List StyleradioButtonListUsing below code, we can create […]... Read More »

CHtml Radio Button

Using CHtml class we are creating radioButton in yii. This post will help you to understand about how to create radioButton in different method, radioButton properties, array value, how to get radioButton value in controller and radioButton validation in model.radioButtonChecked PropertiesradioButton ValueradioButton Validation In ModelGet radioButton Value In ControllerRadioButtonactiveRadioButton With CHtml <?php echo CHtml::activeRadioButton($model,'attribute',array()); ?> CHtml activeRadioButton generates a radio button for a model attribute.radioButton With Form <?php echo $form->radioButton($model,'attribute'); […]... Read More »

Yii Hint For Form Radio Button

This tutorial will help you to style the radio button list on form. Using template, separator, style and label options, We can give proper style to radio button. <div class="row"> <?php echo $form->labelEx($model,'isactive'); ?> <?php echo $form->radioButtonList( $model, 'isactive', array('1'=>'Active','0'=>'Inactive'), array( 'template'=>'{input}{label}', 'separator'=>'', 'labelOptions'=>array( 'style'=>'padding-left:13px;width: 60px;float: left;' ), 'style'=>'float:left;', ) ); ?> <div style="clear: both;"></div> <?php echo $form->error($model,'isactive'); ?> </div>... Read More »

Yii 1.0 Ajax search using Radio Buttons

Would you like to trigger one ajax request While clicking on Radio button, This post will help you to get radio button ajax request.In _search.php (form) <div class="wide form"> <?php $form=$this->beginWidget('CActiveForm', array( 'action'=>Yii::app()->createUrl($this->route), 'method'=>'get', )); ?> <div class="row"> <?php echo $form->radioButtonList( $model, 'status', array( '1'=>'Active', '2'=>'Inacitve' ), array( 'template'=>'{input}{label}', 'separator'=>'', 'labelOptions'=>array('style'=>'padding-left:13px'), 'style'=>'float:left;', 'onclick'=>CHtml::ajax(array( 'success'=>"$('.search-form form').submit()", )) ) ); ?> </div> <?php $this->endWidget(); ?> </div> In Model.php public function searchfiles() { […]... Read More »