I am using deform 2 together with Bootstrap 3, to render some forms, and I want to create a Horizontal form as shown here, but all of the examples on the demo-site, is not examples of horizontal forms( with the label next to the input element).
I have tried using form_class="form-horizontal"
, and bootstrap_form_style="form-horizontal"
(deform_bootstrap). When using the above, it does add the class form-horizontal
, however I dont just want to add a class to the form element.
How do I add the rest of the class names to the rest of the form to make it a horizontal form as is on the the bootstrap site?
I figured it out, in the deform templates(I over write them) I did:
mapping_item.pt:
Notice in the
label
I addedcol-sm-3 col-md-3
Also I added a
<div>
with a class:class="col-sm-9 col-md-9"
This makes the item i.e. label + input 'horizontal'(displays in the same line):
In
form.pt
, in the form tag I added:I also do when define the form layout:
I hope this is helpful.