New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unselect value in activeRadioList #1610
Comments
Thanks. |
The reason is that if you don't select anything, the corresponding form field will not be submitted (if there's no hidden field for the unselect value). As a result, if you are modifying a model, the corresponding field will not be cleared (because it doesn't receive any input for it). |
Ok.
|
For model creation, there's no problem. The problem only happens for updating model. |
Ok. You are right. |
* upstream: (2012 commits) doc fix. Changed the signature of `urlCreator` and button creators for `yii\gridview\ActionColumn` parameter adjustment. The signature for `yii\gridview\ActionColumn::urlCreator` is changed - the `$action` parameter is moved to the first Fixed the signature of Schema::findUniqueIndexes(). reverted yiisoft#1598 and added a test for it Fix wrong array index in unique indexes for MySql Making accesors public Get DB unique indexes information Fixes yiisoft#1610: `Html::activeCheckboxList()` and `Html::activeRadioList()` will submit an empty string if no checkbox/radio is selected Gii should keep horizontal layout Documentation at "yii\authclient" updated. Doc comments at "yii\authclient" updated. Auth clients "Choice" doc comments updated. Auth clients "Choice" widget javascript advanced. Bootstrap's dropdown encodes also trailing caret tag Auth clients "Choice" widget markup updated. Gii should keep horizontal layout extended from codeception testcase, added docs Auth clients for Facebook, GitHub, LinkedIn added. ... Conflicts: framework/yii/helpers/BaseInflector.php tests/unit/framework/helpers/InflectorTest.php
activeRadioList automatically create a unselect value "0" (hidden field) for a given model attribute.
I think that is not a good solution for a comman usage, because when this attribute is required than the required validator add no error because the value is "0".
in Model rules
That means that I must set the unselect option to null that the required validator works.
The text was updated successfully, but these errors were encountered: