Sorry for the vague title, I wasn't sure how to describe it better.
I'm currently upgrading a website to bootstrap 3 and got a little problem with multiple inputs in one form row.
In bootstrap 2, I would have simply created two .controls.controls-row
with .spanX
elements inside to create the necessary columns.
However, as these are removed in bootstrap 3, I replaced them with .form-group
and the new column classes.
If I have two rows inside the form (resp. fieldset in this case), the first one becomes non-editable if the second one is a one-column row (see code and attached screenshot below).
I inspected the elements with firebug and saw that the .col-sm-12
from the second fieldset lays over the .form-group
and does not let the user click the elements inside.
In the first fieldset with the .col-sm-12
first, everything works fine.
I also tried placing a .row
around each .form-group
which solves the issue, but increases the width of the form line, so it does no longer has a left margin inside the fieldset.
Is there a way to solve this without increasing the form-row width?
Thanks in advance!
EDIT: I added the generated code as a jsFiddle
%fieldset
%legend= t('.login_information')
.form-group
.col-sm-12
= f.label :login
= f.text_field :login, :class => 'form-control', :required => true
.form-group
.col-sm-6
= f.label :password
= f.password_field :password, :class => 'form-control'
.col-sm-6
= f.label :password_confirmation
= f.password_field :password_confirmation, :class => 'form-control'
%fieldset
%legend= t('.personal_details')
.form-group
.col-sm-4
= f.label :title
= f.text_field :title, :class => 'form-control'
.col-sm-4
= f.label :firstname
= f.text_field :firstname, :class => 'form-control', :required => true
.col-sm-4
= f.label :lastname
= f.text_field :lastname, :class => 'form-control', :required => true
.form-group
.col-sm-12
= f.label :email
= f.text_field :email, :class => 'form-control email', :required => true
question from:
https://stackoverflow.com/questions/18428871/multi-column-forms-with-fieldsets 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…