neel
(Kazi Neel)
1
How to get CheckBox value? When I checked one of four checkboxes then I got value 1 but I need actual value.
<?php foreach($models as $n=>$form): ?>
<div class="simple">
<?php echo CHtml::activeLabelEx($form,‘telephone’); ?>
<?php echo CHtml::activeCheckBox($form,‘telephone’,CHtml::listData(CActiveRecord::model(‘phoneForm’)->findAll(),‘id’,‘telephone’)); ?>
</div>
<?php endforeach; ?>
jerry2801
(Jerry2801)
2
CVarDumper::dump( $_POST ); see it~maybe can help you~
Volli
(Vaviper5)
4
I think you are searching for
CHtml::activeCheckBoxList()
Regards
neel
(Kazi Neel)
5
I got 1 or 0 when I check but I need actual value. Is that possible?
neel
(Kazi Neel)
6
Here is my view form. When i submit then I got Array, but I need checkbox value. Is that possible?
<?php foreach($models as $n=>$form): ?>
<tr>
<td colspan=2><?php echo CHtml::activeCheckBoxList($form,'personal',array('telephone','email')); ?></td>
</tr>
<?php endforeach; ?>
Volli
(Vaviper5)
7
Sorry, but I have not the time to write some sample code atm. I hope http://www.yiiframework.com/doc/api/1.0.10/CHtml#activeCheckBoxList-detail can help you.
Yes, that is possible
neel
(Kazi Neel)
8
In the controller, If I use this to get array value
$form->systems[0]
then I see the one value. Is that any way to use for loop to get the array value