Replies: 4 comments
-
It's also occurred to me. besides that, there is an issue when the form tries to bind $_POST data with the model instance. .volt Controller
Form: Model:
The code above won't save any string to the password column. But if I updated the getPassword(); it works.
|
Beta Was this translation helpful? Give feedback.
-
It's not working ! Any problem in: |
Beta Was this translation helpful? Give feedback.
-
Having the same issue. It's reported here: #15959 $status = new Check('status', [
'value' => 1,
]);
if (!is_null($entity)) {
$status->setAttribute('checked', $entity->status);
}
$status->setLabel('Status');
$this->add($status); I think the issue lies in the fact that the value in So the check on line 127 in https://github.com/phalcon/cphalcon/blob/master/phalcon/Html/Helper/Input/Checkbox.zep#L127 fails because is strict with |
Beta Was this translation helpful? Give feedback.
-
@mikx33 If you define the following in a class that extends Forms: $elm = new Element\Check('vatEnabled', ['value' => 1]);
$this->add($elm); It should be specified as follows. Also, in .volt, if you call TagFactory directly, you need to specify it like this. It is important to note that even if you pass a numeric value in the second argument of inputCheckbox (), it seems to be treated as a string internally, so the checked value must be given as a string. |
Beta Was this translation helpful? Give feedback.
-
used like this
{{ form.render('vatEnabled', ["class": "custom-control-input", "id": "vatEnabled", "checked" : "checked"]) }}
result:
<input type="checkbox" id="vatEnabled" name="vatEnabled" value="1" class="custom-control-input">
Beta Was this translation helpful? Give feedback.
All reactions