I have two fieldsets in first div and then im using panel but my panel is covering from above div, Please see the below screen shots
1.) With Filedsets and details
2.) After adding panel, Panel-heading to page it covers the whole content
<div class="container">
<div class="enquiry">
<fieldset class="col-md-12">
<legend><h3>Nag</h3></legend>
<div class="row form-group">
<div class="col-md-4">
<h4>DOB: <span>22-April-2001, Male</span> </h4>
<h4>Enquired: <span>07 </span> </h4>
<h4>Academic Year: <span>2017-2018</span></h4>
</div>
<div class="col-md-4">
<h4>Nagarjuna (Father)</h4>
<h4><i class="fa fa-phone"></i> 9635821471</h4>
<h4><i class="fa fa-envelope"></i> <span class="enq-parent-email">nag.akki#gmail.com</span> </h4>
</div>
<div class="col-md-4">
<h4>
<i class="fa fa-home fa-2x"></i>
</h4>
</div>
</div>
</fieldset>
<fieldset class="col-md-12 margin-bottom">
<legend><h3>Overview</h3></legend>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>Current Name: </label>
<input type="text" class="form-control" readonly="" value="Name">
</div>
<div class="col-md-4">
<label>Current Loasdaf Name: </label>
<input type="text" class="form-control" readonly="" value="asdfaiwewrw">
</div>
<div class="col-md-4">
<label>fasdaskdlfa;skdljfa;skldf</label><br>
<input type="radio" name="transport" readonly="" checked=""> Yes
<input type="radio" name="transport" readonly=""> no
</div>
</div>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>Current Address: </label>
<input type="text" class="form-control" readonly="" value="#07, Kondar, Melborne-38">
</div>
<div class="col-md-4">
<label>asdfasdfasdf</label>
<input type="text" class="form-control" readonly="" value="asdfasd">
</div>
<div class="col-md-4">
<label>asdfasdfasdfasd</label><br>
<input type="radio" name="visit" readonly="" checked=""> Yes
<input type="radio" name="visit" readonly=""> no
</div>
</div>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>asdfasdfasdfa</label>
<input type="text" class="form-control" readonly="" value="asdfasdf">
</div>
<div class="col-md-4">
<label>asdfasdfasdfasd</label>
<input type="text" class="form-control" readonly="" value="asdfasdf">
</div>
<div class="col-md-4">
<label>asdfasdfasdfas</label><br>
<input type="radio" name="visit" readonly="" checked=""> Yes
<input type="radio" name="visit" readonly=""> no
</div>
</div>
<div class="row form-group">
<div class="col-md-4">
<label>Enquiry Status </label>
<select class="form-control">
<option value="">Select Status</option>
<option value="Inprogress">Inprogress</option>
<option value="ConvertedtoApplication">Converted to Application</option>
<option value="Cloased, Not Interested"></option>
</select>
</div>
<div class="col-md-8">
<label>Questions ?</label>
<textarea class="form-control" rows="3"></textarea>
</div>
</div>
</fieldset>
</div>
<br>
</div>
This is very strange for me because i never seen such kind of issues.
Waiting for some response, Thanks in Advance!!
You can use row class in bootstrap.try this
<div class="container">
<div class="row">
<div class="enquiry">
<fieldset class="col-md-12">
.................................
</fieldset>
<fieldset class="col-md-12 margin-bottom">
........................................
</fieldset>
</div>
</div>
<div class="row">
<h1>
Add Here your content
</h1>
</div>
</div>
Related
My problem is that first three fields are a little more to the right than the other fields. I don't know how to align those fields with the others.
I have an example on code pen.
Code for one of the problematic fields:
<div class="form-group">
<label for="inputRECE_DES" class="col-sm-2 control-label">Stranka:*</label>
<div class="col-sm-3">
<input type="text" id="inputACCO_NME" name="cACCO_NME" class="form-control" placeholder="#iLocalization._iTTmvc(Context, "#Enter few letters of client or VAT#")" value="#Model.cACCO_NME" />
</div>
<input type="hidden" id="hidden_iACCO_KEY" name="iACCO_KEY" readonly="readonly" value="#Model.iACCO_KEY" />
</div>
It looks like you were just missing a closing form-group DIV tag for your Kontact row, before the clearfix:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<form class="form-horizontal do-not-submit" role="form" id="formJERECEProperties">
<input type="hidden" id="iRECE_KEY" name="iRECE_KEY" value="180001334">
<input type="hidden" id="hidden_cRECE_SRT" name="cRECE_SRT" value="6">
<input type="hidden" name="iENTE_KEY" value="110000007">
<input type="hidden" name="iBUUN_KEY">
<br>
<h3>testing</h3>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Testing</h3>
</div>
<div class="panel-body">
<div class="form-group">
<label for="inputRECE_DBO" class="col-sm-2 control-label">Datum izposoje:</label>
<div class="col-sm-2">
<input type="text" class="form-control datepickerFiduro" name="b53b663f-86cb-422c-9b2a-a407990788e5" id="inputRECE_DBO" data-editable="1" data-default="true" value="08.03.2018" name1="dRECE_DBO">
</div>
<label for="inputRECE_DRE" class="col-sm-2 control-label">Datum vračila:</label>
<div class="col-sm-2">
<input type="text" class="form-control datepickerFiduro" name="a41fa57c-4654-4f13-a5eb-c4abb56a5950" id="inputRECE_DRE" data-editable="1" data-default="true" value="09.03.2018" name1="dRECE_DRE">
</div>
</div>
<div class="form-group">
<label for="inputRECE_DES" class="col-sm-2 control-label">Stranka:*</label>
<div class="col-sm-3">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="inputACCO_NME" name="98a4e8a7-55cb-4ab7-b075-7ab426566f5b" class="form-control ui-autocomplete-input" placeholder="Vpišite nekaj črk partnerja ali IDDDV"
value="" autocomplete="off" name1="cACCO_NME">
</div>
<input type="hidden" id="hidden_iACCO_KEY" name="iACCO_KEY" readonly="readonly" value="170000209" tabindex="-1">
</div>
<div class="form-group">
<label for="selectCONT_KEY" class="col-sm-2 control-label">Kontakt:</label>
<div class="col-sm-3">
<select id="selectCONT_KEY" class="form-control">
</select><input type="hidden" id="hidden_iCONT_KEY" name="iCONT_KEY">
</div>
</div>
<div class="clearfix"></div>
<div class="form-group col-sm-12"></div>
<div class="form-group">
<label for="inputRECE_NME" class="col-sm-2 control-label">Ime reverza:</label>
<div class="col-sm-7">
<input type="text" class="form-control" name="ead8d066-2618-4ed2-b03e-84c6cb46da4d" id="inputRECE_NME" value="" name1="cRECE_NME">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Skladišče:</label>
<div class="col-sm-3">
<select id="inputDIVI_KEY" name="iDIVI_KEY" class="form-control">
<option value="140001070">Centralno skladišče</option>
</select>
</div>
<div class="col-sm-7"> </div>
</div>
<div class="form-group">
<label for="inputRECE_TEL" class="col-sm-2 control-label">Telefon:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="4c40d2be-7f87-4faf-a6ba-0ff9b95be11b" id="inputRECE_TEL" value="" name1="cRECE_TEL">
</div>
<label for="inputRECE_MOB" class="col-sm-1 control-label">Mobilni tel.:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="958d73bd-723b-4234-b625-1927e9cab407" id="inputRECE_MOB" value="" name1="cRECE_MOB">
</div>
<div class="col-sm-1">
</div>
</div>
<div class="form-group">
<label for="inputRECE_EML" class="col-sm-2 control-label">E-pošta:</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="4f653c8e-5613-449c-9b85-6850c8c857d7" id="inputRECE_EML" value="" name1="cRECE_EML">
</div>
<div class="col-sm-5">
</div>
</div>
<div class="form-group">
<label for="inputRECE_NTO" class="col-sm-2 control-label">Opomba:</label>
<div class="col-sm-7">
<textarea class="form-control" id="inputRECE_NTO" name="cRECE_NTO">Prevzel je:
2 kom line
2 kom corner</textarea>
</div>
<div class="col-sm-3">
</div>
</div>
<div class="form-group">
<label for="selectRECE_STA" class="col-sm-2 control-label">Status:</label>
<div class="col-sm-2">
<select id="selectRECE_STA" name="cRECE_STA" class="form-control">
<option value="A" selected="">Osnutek</option>
<option value="B">Izdan</option>
<option value="9">Izbrisan</option>
</select>
</div>
<div class="col-sm-8">
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div>
</form>
The elements (in your codepen code) have different padding values due to different classes applied to them, which causes the different distance/width. Use a common class for all similar elements and a highly specific CSS selector to overwrite those settings with a common padding setting.
I'm using the bootstrap 3 grid system and I'm wondering how I can get the 'Contact Details' tab to show under the 'Date of Birth' tab without any large white blank space?
I've attached some of the code used on the page which you can see being replicated on the screenshot. You will see from the code that the 'Contact Details' are quite a bit down the page. I am able to figure out the offset but just not the placement of the code.
<form method="post" role="form">
<div class="row setup-content" id="step-1">
<h3>
Partner Details <small>* marks a required field</small>
</h3>
<br>
<div class="row">
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Name and address
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="title">
Title
</label>
<select id="inputtitle" name="title" class="form-control" onchange="updateReview('title');" tabindex=1 />
<option value="" class="disabled" {if isset($val_title)}selected{/if}>Please select</option>
<option value="Master" {if $val_title eq "Master"} selected{/if}>Master</option>
<option value="Mr" {if $val_title eq "Mr"} selected{/if}>Mr</option>
<option value="Mrs" {if $val_title eq "Mrs"} selected{/if}>Mrs</option>
<option value="Miss" {if $val_title eq "Miss"} selected{/if}>Miss</option>
<option value="Ms" {if $val_title eq "Ms"} selected{/if}>Ms</option>
<option value="Rev." {if $val_title eq "Rev."} selected{/if}>Rev.</option>
</select>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="firstname">
First Name
<span class="asteriskField">
*
</span>
</label>
<input value="{$val_firstname}" type="text" onchange="updateReview('firstname');" class="form-control inputfirstname" id="firstname" name="firstname" placeholder="First Name" tabindex=2 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="surname">
Surname
<span class="asteriskField">
*
</span>
</label>
<input value="{$val_surname}" type="text" onchange="updateReview('surname');" class="form-control inputsurname" id="surname" name="surname" placeholder="Surname" tabindex=3 />
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="address1">
Address Line 1
</label>
<input value="{$val_address1}" type="text" onchange="updateReview('address1');" class="form-control inputaddress1" id="address1" name="address1" placeholder="Address Line 1" tabindex=4 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="address2">
Address Line 2 <small>(optional)</small>
</label>
<input value="{$val_address2}" type="text" onchange="updateReview('address2');" class="form-control inputaddress2" id="address2" name="address2" placeholder="Address Line 2" tabindex=5 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="citytown">
City/Town
</label>
<input value="{$val_citytown}" type="text" onchange="updateReview('citytown');" class="form-control inputcitytown" id="citytown" name="citytown" placeholder="City/Town" tabindex=6 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="county">
County
</label>
<input value="{$val_county}" type="text" onchange="updateReview('county');" class="form-control inputcounty" id="county" name="county" placeholder="County" tabindex=7 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="country">
Country
</label>
<select id="inputcountry" name="country" class="form-control" name="country" onchange="updateReview('country');" tabindex=8 />
<option>Please select</option>
<option>Scotland</option>
<option>England</option>
<option>Wales</option>
<option>Northern Ireland</option>
<option>Other</option>
</select>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="postalcode">
Postal Code
</label>
<input value="{$val_postalcode}" type="text" onchange="updateReview('postalcode');" class="form-control inputpostalcode" id="postalcode" name="postalcode" placeholder="Postal Code" tabindex=9 />
</div>
</div>
</div>
</div>
<!-- END COL-MD-8 -->
</div>
<!-- END ROW -->
</div>
<!-- END STEP 1 -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Date of Birth
</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div>
</div>
<div class="col-md-4 col-md-offset-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Contact Details
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="home">
Home Telephone Number
</label>
<input value="{$val_hometel}" type="tel" onchange="updateReview('home');" class="form-control inputhome" id="home" name="hometel" placeholder="Home Telephone Number" tabindex=11 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="mobile">
Mobile Telephone Number
</label>
<input value="{$val_mobtel}" type="tel" onchange="updateReview('mobile');" class="form-control inputmobile" id="mobile" name="mobtel" placeholder="Mobile Telephone Number" tabindex=12 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="email">
Email Address
</label>
<input value="{$val_email}" type="text" onchange="updateReview('email');" class="form-control inputemail" id="email" name="email" placeholder="Email Address" tabindex=13 />
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<button class="btn btn-primary nextBtn btn-lg pull-right" type="button" tabindex=10 /> Next
</button>
</div>
</div>
You can get the 'contact details' part just below 'date of birth' part if you put both of them inside same div element. Try this code.
<form method="post" role="form">
<div class="row setup-content" id="step-1">
<h3>
Partner Details <small>* marks a required field</small>
</h3>
<br>
<div class="row">
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Name and address
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="title">
Title
</label>
<select id="inputtitle" name="title" class="form-control" onchange="updateReview('title');" tabindex=1 />
<option value="" class="disabled" {if isset($val_title)}selected{/if}>Please select</option>
<option value="Master" {if $val_title eq "Master"} selected{/if}>Master</option>
<option value="Mr" {if $val_title eq "Mr"} selected{/if}>Mr</option>
<option value="Mrs" {if $val_title eq "Mrs"} selected{/if}>Mrs</option>
<option value="Miss" {if $val_title eq "Miss"} selected{/if}>Miss</option>
<option value="Ms" {if $val_title eq "Ms"} selected{/if}>Ms</option>
<option value="Rev." {if $val_title eq "Rev."} selected{/if}>Rev.</option>
</select>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="firstname">
First Name
<span class="asteriskField">
*
</span>
</label>
<input value="{$val_firstname}" type="text" onchange="updateReview('firstname');" class="form-control inputfirstname" id="firstname" name="firstname" placeholder="First Name" tabindex=2 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="surname">
Surname
<span class="asteriskField">
*
</span>
</label>
<input value="{$val_surname}" type="text" onchange="updateReview('surname');" class="form-control inputsurname" id="surname" name="surname" placeholder="Surname" tabindex=3 />
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="address1">
Address Line 1
</label>
<input value="{$val_address1}" type="text" onchange="updateReview('address1');" class="form-control inputaddress1" id="address1" name="address1" placeholder="Address Line 1" tabindex=4 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="address2">
Address Line 2 <small>(optional)</small>
</label>
<input value="{$val_address2}" type="text" onchange="updateReview('address2');" class="form-control inputaddress2" id="address2" name="address2" placeholder="Address Line 2" tabindex=5 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="citytown">
City/Town
</label>
<input value="{$val_citytown}" type="text" onchange="updateReview('citytown');" class="form-control inputcitytown" id="citytown" name="citytown" placeholder="City/Town" tabindex=6 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="county">
County
</label>
<input value="{$val_county}" type="text" onchange="updateReview('county');" class="form-control inputcounty" id="county" name="county" placeholder="County" tabindex=7 />
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="country">
Country
</label>
<select id="inputcountry" name="country" class="form-control" name="country" onchange="updateReview('country');" tabindex=8 />
<option>Please select</option>
<option>Scotland</option>
<option>England</option>
<option>Wales</option>
<option>Northern Ireland</option>
<option>Other</option>
</select>
</div>
</div>
<div class="col-xs-6 col-md-4">
<div class="form-group">
<label for="postalcode">
Postal Code
</label>
<input value="{$val_postalcode}" type="text" onchange="updateReview('postalcode');" class="form-control inputpostalcode" id="postalcode" name="postalcode" placeholder="Postal Code" tabindex=9 />
</div>
</div>
</div>
</div>
<!-- END COL-MD-8 -->
</div>
<!-- END ROW -->
</div>
<!-- END STEP 1 -->
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Date of Birth
</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Contact Details
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="home">
Home Telephone Number
</label>
<input value="{$val_hometel}" type="tel" onchange="updateReview('home');" class="form-control inputhome" id="home" name="hometel" placeholder="Home Telephone Number" tabindex=11 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="mobile">
Mobile Telephone Number
</label>
<input value="{$val_mobtel}" type="tel" onchange="updateReview('mobile');" class="form-control inputmobile" id="mobile" name="mobtel" placeholder="Mobile Telephone Number" tabindex=12 />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-12">
<div class="form-group">
<label for="email">
Email Address
</label>
<input value="{$val_email}" type="text" onchange="updateReview('email');" class="form-control inputemail" id="email" name="email" placeholder="Email Address" tabindex=13 />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<button class="btn btn-primary nextBtn btn-lg pull-right" type="button" tabindex=10 /> Next
</button>
</div>
</div>
I have an HTML page in which I have different input fields, some with a unit and some without one.
When I add an input-group-addon class to the span, the width of the whole input gets totally messed up.
My question is, what can I do so that my input "Field 1" is aligned with the other two, both on the left and on the right ?
I tried adding a margin-left: 15px; on the field 1, but unfortunately, this gives this ouput, which is not looking great.
I am using Bootstrap for the fields. Thanks.
Here is the code for the HTML:
.inputUnite {
margin-left: 15px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div>
<div class="composant">
<div class="form-group row">
<div class="col-md-12">
<div class="control-label">
<label for="input_A2B"><span class="symbol-required">*</span><span>Field 1</span></label>
</div>
</div>
<div class="col-md-6 input-group">
<input class="form-control inputUnite" aria-invalid="false" required="required" data-format="numeric" maxlength="6" id="input_A2B" name="a2b.value" value="" data-spinnertabindex="null" tabindex="null">
<span class="input-group-addon" id="unit_A2B">cm</span>
</div>
</div>
</div>
</div>
<div>
<div class="composant">
<div class="form-group row">
<div class="col-md-12">
<div class="control-label">
<label for="input_T5ZA2"><span class="symbol-required">*</span><span>Field 2</span></label>
</div>
</div>
<div class="col-md-6">
<input class="form-control" aria-invalid="false" required="required" data-format="alphanumerique" maxlength="2" id="input_T5ZA2" name="T5ZA2.value" value="" data-spinnertabindex="null" tabindex="null">
</div>
</div>
</div>
</div>
<div>
<div class="composant">
<div class="form-group row has-error">
<div class="col-md-12">
<div class="control-label">
<label for="textarea_A3D"><span class="symbol-required">*</span><span>Field 3</span></label>
</div>
</div>
<div class="col-md-6">
<textarea class="form-control has-error" aria-invalid="true" required="required" data-format="alphabetique" maxlength="558" id="textarea_A3D" name="A3D.value" data-spinnertabindex="null" tabindex="null"></textarea>
<p class="letter-count" aria-live="polite"><span>558</span> caractères restants</p>
</div>
</div>
</div>
</div>
Adding another class inside the div col-md-6 was the reason it messed up.
So what I did was to separate the code in two different , as follows:
<div>
<div class="composant">
<div class="form-group row has-error">
<div class="col-md-12">
<div class="control-label">
<label for="input_A2B">
<!-- caractère obligatoire -->
<span class="symbol-required">*</span>
<span>Field 1</span>
</label>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<input class="form-control" aria-invalid="true" required="required" data-format="numeric" maxlength="6" id="input_A2B" name="a2b.value" value="" data-spinnertabindex="null" tabindex="null">
<span class="input-group-addon" id="unité_A2B">cm</span>
</div>
</div>
</div>
</div>
</div>
If all you wont is to margin 15px to the left, move the class inputUnite (the one you defined), from the form-control div to the parent div, the input-group.
That will apply the changes to the all input group, the input and the 'cm' span.
For that style to apply only on the input-group, you need to wrap the col-md-6 div with a row div' and seperate the all the outher input fileds to another row div.
In the code below I added a second input field so we could see the relative position, each input is in is own row div.
<div>
<div class="composant">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="control-label">
<label for="input_A2B">
<span class="symbol-required">*</span>
<span>Field 1</span>
</label>
</div>
</div>
<div class="col-md-6 inputUnite input-group">
<input class="form-control" aria-invalid="false" required="required" data-format="numeric" maxlength="6" id="input_A2B" name="a2b.value"
value="" data-spinnertabindex="null" tabindex="null">
<span class="input-group-addon" id="unit_A2B">cm</span>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-label">
<label for="input_A2C">
<span class="symbol-required">*</span>
<span>Field 2</span>
</label>
</div>
</div>
<div class="col-md-6">
<input class="form-control" id="input_A2C" aria-invalid="false" required="required" data-format="numeric">
</div>
</div>
</div>
</div>
codepen
Just remove your input-group from the .col-md-6 and make an another div inside .col-md-6 with class input-group for better understanding of code.
Also use .container or .container-fluid class outside of .row...
No need to use .inputUnite class here...
Stack Snippet
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="container-fluid">
<div class="composant">
<div class="form-group row">
<div class="col-md-12">
<div class="control-label">
<label for="input_A2B"><span class="symbol-required">*</span><span>Field 1</span></label>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<input class="form-control inputUnite" aria-invalid="false" required="required" data-format="numeric" maxlength="6" id="input_A2B" name="a2b.value" value="" data-spinnertabindex="null" tabindex="null">
<span class="input-group-addon" id="unit_A2B">cm</span>
</div>
</div>
</div>
</div>
<div class="composant">
<div class="form-group row">
<div class="col-md-12">
<div class="control-label">
<label for="input_T5ZA2"><span class="symbol-required">*</span><span>Field 2</span></label>
</div>
</div>
<div class="col-md-6">
<input class="form-control" aria-invalid="false" required="required" data-format="alphanumerique" maxlength="2" id="input_T5ZA2" name="T5ZA2.value" value="" data-spinnertabindex="null" tabindex="null">
</div>
</div>
</div>
<div class="composant">
<div class="form-group row has-error">
<div class="col-md-12">
<div class="control-label">
<label for="textarea_A3D"><span class="symbol-required">*</span><span>Field 3</span></label>
</div>
</div>
<div class="col-md-6">
<textarea class="form-control has-error" aria-invalid="true" required="required" data-format="alphabetique" maxlength="558" id="textarea_A3D" name="A3D.value" data-spinnertabindex="null" tabindex="null"></textarea>
<p class="letter-count" aria-live="polite"><span>558</span> caractères restants</p>
</div>
</div>
</div>
</div>
I am trying to create a form using bootstrap 3 that looks like
this.
I can get it to look pretty similar, but the only problem I have is that my last horizontal rule in the ETO section goes the entire way across. Is there any way I can make this only go across half of the page? I tried putting it in different col sizes inside that but I couldn't get it to work. Here's my html. Thanks ahead of time!
<div class="panel panel-default">
<div class="panel-heading">
<label style="color: white; font-weight: bold;">JOHNSON Summary</label>
</div>
<div class="panel-body">
<form class="form-horizontal" role="form" style="overflow-x:auto;">
<fieldset>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> Status </label>
<div class="col-xs-7">
<select class="form-control" id="empStatus">
<option value="" disabled>Choose Type....</option>
<option value="Current">Current</option>
<option value="Terminated">Terminated</option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> Anniversary </label>
<div class="col-xs-7">
<input class='form-control' type="text" id="empAnniversary"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> Start Date </label>
<div class="col-xs-7">
<input class='form-control' type="date" id="empStartDate"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> Adjusted Start </label>
<div class="col-xs-7">
<input class='form-control' type="date" id="empAdjustedStart"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> STD/LTD </label>
<div class="col-xs-7">
<input class='form-control' type="text" id="empSTDLTD"/>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-5"> Uncharged </label>
<div class="col-xs-7">
<input class='form-control' type="text" id="empUncharged"/>
</div>
</div>
</div>
</fieldset>
<fieldset>
<h4>PTO</h4>
<div class="col-xs-12">
<div class="form-group">
<div class="col-xs-1"></div>
<label class="col-xs-2"> Base </label>
<div class="col-xs-3">
<input class='form-control' type="text" id="ptoBase" />
</div>
<div class="col-xs-6">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-2" style="font-weight: bold;"> + </label>
<label class="col-xs-4"> Carryover </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoCarryover" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<div class="col-xs-1"></div>
<label class="col-xs-4"> Balance </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoBalance" />
</div>
<div class="col-xs-1"></div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-2" style="font-weight: bold;"> ― </label>
<label class="col-xs-4"> Borrowed </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoBorrowed" />
</div>
</div>
<hr style="border: solid 1px black;border-bottom:1px solid black;clear:both" />
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-1" style="font-weight: bold;"> ― </label>
<label class="col-xs-4"> Requests </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoRequests" />
</div>
<div class="col-xs-1"></div>
</div>
<hr style="border: solid 1px black;border-bottom:1px solid black;clear:both" />
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-2" style="font-weight: bold;"> = </label>
<label class="col-xs-4"> Balance </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoBalance" />
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-xs-1" style="font-weight: bold;"> = </label>
<label class="col-xs-4"> Available </label>
<div class="col-xs-6">
<input class='form-control' type="text" id="ptoAvailable" />
</div>
<div class="col-xs-1"></div>
</div>
</div>
</fieldset>
<fieldset>
<h4>ETO</h4>
<div class="col-xs-12">
<div class="form-group">
<div class="col-xs-1"></div>
<label class="col-xs-2"> Earned </label>
<div class="col-xs-3">
<input class='form-control' type="text" id="etoEarned" />
</div>
<div class="col-xs-6">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-xs-1"> ― </label>
<label class="col-xs-2"> Requests </label>
<div class="col-xs-3">
<input class='form-control' type="text" id="etoRequested" />
</div>
<div class="col-xs-6">
</div>
</div>
<hr style="border: solid 1px black;border-bottom:1px solid black;clear:both" />
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-xs-1"> = </label>
<label class="col-xs-2"> Available </label>
<div class="col-xs-3">
<input class='form-control' type="text" id="etoAvailable" />
</div>
<div class="col-xs-6">
</div>
</div>
</div>
</fieldset>
</form>
</div>
</div>
UPDATED.
I think you need to use Bootstrap's horizontal form as described in official docs. It seems you are using horizontal form structure, but you've forgotten to add .form-horizontal class to your form element or to .form-group.
Due to the boot strap design, the keyboard tab key is working vertically(col wise) instead of horizontally.
Can I make the keyboard tab key behavior horizontal(default behavior) without changing the design
This is the section of code.
<div class="col-md-4">
<div class="form-group col-md-12">
<span class="col-md-6">
<select ng-model="typeId" required=""><option value="" class="" selected="selected">--SELECT--</option>
<option label="Employment" value="number:2">Employment</option>
<option label="Female" value="number:3">Female</option>
<option label="Food" value="number:4">Food</option>
<option label="Male" value="number:1">Male</option>
</select>
</span>
</div>
<div class="form-group col-md-12" ">
<span class="col-md-6">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</span>
</div>
<div class="form-group col-md-12">
<span class="col-md-6">
<select ng-model="nId" ng-options="non.nId as non.nlity for non in List" ng-invalid-required" name="nationality" id="nationality" required="">
</select>
</span>
</div>
<div class="form-group col-md-12">
</div>
<div class="form-group col-md-12">
<label class="col-md-6" for="profession">Profession:</label>
<span class="col-md-6">
<select ng-model="rpationId" ng-options="ocp.rpationId as ocp.occupation for ocp in occupationList" >\
</select>
</span>
</span>
</div>
</div>
<div class="col-md-4">
<div class="form-group col-md-12" ng-class="{ 'has-error' : regCtrl.userForm.mmpId.$invalid && regCtrl.userForm.mmpId.$dirty }">
<label class="col-md-6" for="mmpId">MMP Id: *</label>
<span class="col-md-6">
<input type="text" name="mmpId" class="form-control ">
</span>
<div class="col-sm-6 error-color ng-scope ng-active" >
<span ng-message="required" class="ng-scope">This field is required</span>
</div>
</div>
<div class="form-group col-md-12" >
<label class="col-md-6" for="name">Name: *</label>
<span class="col-md-6">
<input type="text" name="name" ng-maxlength="250">
</span>
</div>
<div class="form-group col-md-12" >
<label class="col-md-6" for="dob">Date of Birth: *</label>
<span class="col-md-6">
<input type="date" name="dob" ng-maxlength="11">
</span>
</div>
<div class="form-group col-md-12" ng-class="">
<label class="col-md-6" for="contactNo">Contact No: *</label>
<span class="col-md-6">
<input type="number" name="contactNo" required="">
</span>
</div>
</div>
This is because of your grouping of the form elements. You are grouping the elements column wise hence the tab works column wise.
You have grouped 4 form elements in first col-md-4 and the next 4 in the second col-md-4 so default tab control will first cover first col-md-4 elements and then the next col-md-4 elements.
Either use tabindex or change your layout to row wise as below:
<div class="row">
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
<div class="col-md-4">
<div class="form-group col-md-12">
<input type="text" name="nameAr" required="" ng-maxlength="250">
</div>
</div>
</div>
Hope it helps.