setting 'id' in htmlOptions for a horizontalForm checkBoxRow gives an improper label for-attribute

Issue #72 resolved
created an issue

$form->checkBoxRow($model, 'attrName', array('id' => 'superSpeciald')); the input checkbox gets the proper id (superSpecialId), but the labels for-attribute gets 'ModelAttrName'

solved by changing widgets/input/BootInputHorizontal.php line 52 to echo '<label class="checkbox" for="'.(isset($this->htmlOptions['id']) ? $this->htmlOptions['id'] : CHtml::getIdByName(CHtml::resolveName($this->model, $attribute))).'">';

edit 2012-04-26 same problem with BootInputHorizontal::getLabel() resolved by adding following to getLabel() line 40 in same file as above.

    if (isset($this->htmlOptions['id'])) {
        $htmlOptions['for'] = $this->htmlOptions['id'];

Comments (3)

  1. Log in to comment