ps_sach
(Ps Sach)
1
Hello All,
I have yii form which has a checkbox.
The code is like this -
echo "<input name='actions[]' value='$value' type='checkbox' />";
But in view source I can see -
<input name="actions[]" value="List" type="checkbox" style="display: none;">
Because of the style, checkbox is not getting displayed.
I have tried something like this with no luck -
echo CHtml::CheckBox('actions[]', '', array('value'=>$key));
Please help.
Thank you!!
oligalma
(Marc Oliveras)
2
Have you tried to use CActiveForm::checkbox instead?
<div class="row rememberMe">
<?php echo $form->labelEx($model,'attribute'); ?>
<?php echo $form->checkBox($model,'attribute'); ?>
<?php echo $form->error($model,'attribute'); ?>
</div>
http://www.yiiframework.com/doc/api/1.1/CActiveForm#checkBox-detail
ps_sach
(Ps Sach)
3
Thank you moginn for the reply.
I do not have model here and I want to have checkbox array.
How can I do it?
Thank you!
oligalma
(Marc Oliveras)
4
alirz23
(Ali Raza)
5
ps_sach
(Ps Sach)
9
Thank you very much to all of you for the replies.
My scenario is quiet complex,
The html code looks like this -
So its difficult to use checkbox list box.
And I can not give different checkbox list names to different checkbox blocks as shown between the texts and other html elements.
I have to make it work using checkbox only.
Thank you!