Skip to content
This repository has been 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

Closed
kryten87 opened this issue Sep 9, 2015 · 2 comments

Comments

@kryten87
Copy link

kryten87 commented Sep 9, 2015

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?

@adamwathan
Copy link
Owner

Definitely not by design! Fixed here: bac19cb

Tagged 0.7.0 with that fix for ya.

@henriquesobral
Copy link

Hi,
Same thing with BootForm::file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants