DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Append CheckBoxFor different CSS height #317

Closed wstaelens closed 10 years ago

wstaelens commented 10 years ago

bmvc layout form See attachment, the appended control is much higher. I'm using: @form.FormGroup().TextBoxFor(x => x.Foo).Id("bar").Append(@Html.Bootstrap().CheckBoxFor(x => x.FooBar).Label().LabelText(Resources.FooBar)).Label().LabelText("Foo:")

DmitryEfimenko commented 10 years ago

This is due to couple issues.

  1. Bootstrap does not support labeled checkboxes as appendixes. Only single checkboxes.
  2. If you want to apply label to the checkbox inside appendix, a bit different html structure needs to be used, Try this:
@form.FormGroup().TextBoxFor(x => x.Foo).Id("bar").Append(@Html.Bootstrap().CheckBoxFor(x => x.FooBar).ToString() + Html.Bootstrap().LabeFor(x => x.FooBar).LabelText(Resources.FooBar)).Label().LabelText("Foo:")

Notice that additional css might need to be applied.

DmitryEfimenko commented 10 years ago

did this work for you?

wstaelens commented 10 years ago

Yes, i've solved it in a different layout. Thanks.