I have a complex web form with multiple fields in a single line. The Bootstrap inline form works well on larger screens, but now I need to make the page responsive so that the inline form will switch to a 3-column grid layout on smaller screens like tablets and phones.
Here is the inline form on a large screen:
https://i.sstatic.net/XsDAQ.png
And here is the required layout for mobile screens:
https://i.sstatic.net/xQOwt.png
Is this possible to achieve in Bootstrap 3?
I would greatly appreciate any tips or advice on how to implement this change!
Code Snippet:
<div class="container">
<form class="form-horizontal" data-toggle="validator" role="form" action="" method="post" id="form1">
<fieldset style="background-color:#F7F7F7">
<div class="row">
<div class="form-inline" style="text-align:left">
<div class="form-group" style="margin-right:30px;">
<div class="floating-label-form-group" style="top:-5px;width:180px">
<label class="control-label" for="Selection1">Selection1</label>
<select id="Selection1" name="Selection1" class="form-control relationship selectpicker" required>
<option value="" disabled selected>Selection1 *</option>
<option value="1">option 1</option>
<option value="2">option 2/option>
<option value="3">option 3</option>
</select>
</div>
<span class="help-block with-errors"></span>
</div>
<div class="form-group ">
<div class="floating-label-form-group">
<label class="control-label" for="fName">1st Name</label>
<input id="fName" name="fName" type="text" required>
</div>
<span class="help-block with-errors"></span>
</div>
<div class="form-group " style="margin-right:30px">
<div class="floating-label-form-group">
<label class="control-label" for="lName">Last Name</label>
<input id="lName" name="lName" type="text" required>
</div>
<span class="help-block with-errors"></span>
</div>
<div class="form-group">
<div class="floating-label-form-group" style="top:-5px;width:120px">
<label class="control-label" for="gender">Gender</label>
<select id="gender" name="gender" class="form-control selectpicker" required>
<option value="" disabled selected>gender *</option>
<option value="1">M</option>
<option value="2">F</option>
</select>
</div>
<span class="help-block with-errors"></span>
</div>
<div class="form-group">
<div class="floating-label-form-group" style="top:-5px;width:160px">
<label class="control-label" for="selection2">Selection2</label>
<select id="selection2" name="selection2" class="form-control selectpicker" required>
<option value="" disabled selected>Selection2 *</option>
<option value="1">option 1</option>
<option value="2">option 2</option>
</select>
</div>
<span class="help-block with-errors"></span>
</div>
</div>
</div><!-- /row -->
</fieldset>
</form>