$form = ActiveForm::begin();
echo Html::activeDropDownList($model,
'client_key',
ArrayHelper::map(ListClient::find()->all(), 'client_key', 'cli_stat_name_l'),
['prompt'=>'All Clients...'],
['onchange'=>'this.form.submit()']);
ActiveForm::end();
activeDropDownList onchange didnot working when have ['prompt'=>'All Clients...'],
I comment ['prompt'=>'All Clients...'], it work
| Q | A
| ---------------- | ---
| Yii version | 2.0.10
| PHP version | PHP Version 5.6.3
| Operating system | windows 7
Is your example above as it is in your code? If so you've got the options as two separate parameters which is why it'll work when you comment it out.
Try
echo Html::activeDropDownList(
$model,
'client_key',
ArrayHelper::map(ListClient::find()->all(), 'client_key', 'cli_stat_name_l'),
['prompt'=>'All Clients...', 'onchange'=>'this.form.submit()']
);
@Alex-Code is right
Thank you for your question.
In order for this issue tracker to be effective, it should only contain bug reports and feature requests.
We advise you to use our community driven resources:
If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.
_This is an automated comment, triggered by adding the label question
._
Most helpful comment
Is your example above as it is in your code? If so you've got the options as two separate parameters which is why it'll work when you comment it out.
Try