Answer the question
In order to leave comments, you need to log in
How to properly work with checkbox in yii1?
Checkbox in file
<label>
<?php echo $form->checkBox($model, 'home_office'); ?>
выезд в офис / на дом
</label>
<label>
<input id="ytUser_home_office" type="hidden" value="0" name="User[home_office]"><div id="User_home_office-styler" class="jq-checkbox" unselectable="on" style="-webkit-user-select: none; display: inline-block; position: relative; overflow: hidden;"><input name="User[home_office]" id="User_home_office" value="1" type="checkbox" style="position: absolute; z-index: -1; opacity: 0; margin: 0px; padding: 0px;"><div class="jq-checkbox__div"></div></div> Возможен выезд в офис / на дом
</label>
Array ( [home_office] => 0
Answer the question
In order to leave comments, you need to log in
www.yiiframework.com/doc/api/1.1/CHtml#activeCheck...
A special option named 'uncheckValue' is available that can be used to specify the value returned when the checkbox is not checked. By default, this value is '0'. Internally, a hidden field is rendered so that when the checkbox is not checked, we can still obtain the posted uncheck value. If 'uncheckValue' is set as NULL, the hidden field will not be rendered.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question