Closed spiritdead closed 8 years ago
It can't be. We're not transforming attribute case. Most probably you're checking in Chrome web inspector which does that. Check page source instead.
This is an automated comment, triggered by adding the label question
.
Please note, that the GitHub Issue Tracker is for bug reports and feature requests only.
We are happy to help you on the support forum, on IRC (#yii on freenode), or Gitter.
Please use one of the above mentioned resources to discuss the problem. If the result of the discussion turns out that there really is a bug in the framework, feel free to come back and provide information on how to reproduce the issue. This issue will be closed for now.
@samdark if i define the attribute
why if this work
$js = <<<JS
$('input#bird-bird_external').on('ifToggled',function(event){ $("#bird-name").prop("disabled",!this.checked);});
JS;
$this->registerJs($js);
why the other option work and the problem is the uppercase in the params
and is easy reproduce you can confirm fast :/
add any attribute using mayus example
I can't confirm it at all. Please provide steps to reproduce the problem starting with basic app template.
@samdark
in the example i used this http://icheck.fronteed.com/
add this in the assets
and a second .js with this
$(document).ready(function () {
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
});
the callback ifToggled input's checked state is changed
$jsExternals = 'console.log("hello");';
<?= $form->field($model,'bird_external')->checkbox(['class' => 'i-checks','ifToggled' => $jsExternals]) ?>
you can see if work in the console of the browser, and the event is never fired
but when you add using this method (jquery directly) work
$js = <<<JS
$('input#bird-bird_external').on('ifToggled',function(event){console.log("hello");});
JS;
$this->registerJs($js);
Well, 'ifToggled' => $jsExternals
isn't about event handling at all. It sets attribute value.
If you absolutely want JavaScript in the value, check http://www.yiiframework.com/doc-2.0/yii-web-jsexpression.html
What steps will reproduce the problem?
im adding attributes with mayus (ifToggled) and this render in lower (iftoggled)
What is the expected result?
if i define in mayus the attribute ifToggled the render display the same result ifToggled
Additional info
im using this
and the render display
if can see the attribute iftoggled is lowecapped
steps to reproduce:
add any attribute in mayus, and the rendered is lowercapped