<?php
echo $form->radioButtonList($model,'MODELID',CHtml::listData($model::model()->findAll(), 'MODELID', 'MODELNAME'),array('separator'=>' ','labelOptions'=>array('style'=>'display:inline'),'class'=>'rad','onchange'=>'getRadioValue();'));
echo CHtml::hiddenField('dataModel','',array('id' => 'dataModel'));
?>
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
?>
<script>
function getRadioValue(){
var value = $("input[type='radio']:checked").val();
$("#dataModel").val(value);
}
</script>
echo $form->radioButtonList($model,'MODELID',CHtml::listData($model::model()->findAll(), 'MODELID', 'MODELNAME'),array('separator'=>' ','labelOptions'=>array('style'=>'display:inline'),'class'=>'rad','onchange'=>'getRadioValue();'));
echo CHtml::hiddenField('dataModel','',array('id' => 'dataModel'));
?>
<?php
Yii::app()->clientScript->registerCoreScript('jquery');
?>
<script>
function getRadioValue(){
var value = $("input[type='radio']:checked").val();
$("#dataModel").val(value);
}
</script>
No comments:
Post a Comment