Skip to content
This repository was archived by the owner on Feb 26, 2018. It is now read-only.
This repository was archived by the owner on Feb 26, 2018. It is now read-only.

Checkbox attributes are applied to div.form-group instead of the input element #73

@kryten87

Description

@kryten87

I'm building a form using knockout.js & I'm adding data-bind elements to my form controls.

Doing this: BootForm::text('My Control', 'my_control')->attribute('data-bind', 'value: my_value') yields the following:

<div class="form-group">
    <label class="col-sm-2 control-label" for="my_control">My Control</label>
    <div class="col-sm-10">
        <input type="text" name="my_control" id="my_control" class="form-control" data-bind="value: my_value">
        <span class="validationMessage" style="display: none;"></span>
    </div>
</div>

which is correct. This also works for select elements.

However, doing this: BootForm::checkbox('My Control', 'my_control')->attribute('data-bind', 'checked: my_value') yields this:

<div class="form-group" data-bind="checked: my_value">
    <div class="col-sm-offset-2 col-sm-10">
        <div class="checkbox">
            <label><input type="checkbox" name="my_control" value="1">My Control</label>
        </div>
    </div>
</div>

Is this by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions