How to set this div with height as auto? - html

I have a div with css as this
#middle2 {
background: none repeat scroll 0 0 #ffffff;
border: 1px solid #e5e5e5;
border-radius: 15px;
height: 480px;
margin-left: 230px;
margin-top: 20px;
position: absolute;
width: 500px;
}
The html is this one
<div id="middle2" style="height: auto; overflow: hidden;">
<div id="envelop"></div>
<div id="envelop_title">Create your Account</div>
<div id="e_text">
<p>Creating a account is very easy. Just fill-in the form below, click Submit and then proceed to Login! All done!
</p>
</div>
<div id="c_form">
<div id="form_content" style="height:auto; overflow: hidden;">
<form method="post" action="#" onsubmit="return validation()">
<div class="form_row">
<label class=""><span class="star">*</span> First Name</label>
<div class="inputstyle">
<input class="input_col2" type="text" value="" name="first_name" id="np_first_name"/>
<div id="firstName_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Last Name</label>
<div class="inputstyle">
<input class="input_col2" type="text" value="" name="last_name" id="np_last_name"/>
<div id="lastName_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> E-mail</label>
<div class="inputstyle">
<input class="input_col2" type="text" value="" name="email" id="np_email" onkeyup="check_email()" autocomplete="off"/>
<input type="hidden" id="ch_add" name="ch_add" value="">
<div id="email_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Password </label>
<div class="inputstyle">
<input class="input_col2" type="password" value="" name="password" id="np_password"/>
<div id="pwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Confirm Password </label>
<div class="inputstyle">
<input class="input_col2" type="password" value="" name="cpassword" id="np_cpassword"/>
<input type="hidden" name="ip" id="np_ip" value="<?php echo $this->input->ip_address();?>">
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Contact </label>
<div class="inputstyle">
<input class="input_col2" type="text" value="" name="contact" id="contact"/>
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Address </label>
<div class="inputstyle">
<textarea class="input_col2" name="address" id="address"></textarea>
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> Country </label>
<div class="inputstyle">
<select class="input_col2" id="country" name="country"
onchange="get_state(this.value,'state');">
<option value="0">Select Country</option>
<?php
$country_list = $this->autoload_model->get_data_from_table("td_country","*",
"country_title LIKE '%Canada%'")->result_array();
foreach($country as $bil_cnt)
{?>
<option value="<?php echo $bil_cnt['country_id'];?>">
<?php echo $bil_cnt['country_title'];?>
</option>
<?php
}?>
</select>
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> State </label>
<div class="inputstyle">
<img src="<?php echo base_url();?>assets/front_assets/images/ajax-loader-1.gif" style="margin: 0 0 0 20px; display:none" id="state_loader"/>
<select class="input_col2" id="state" name="state"
onchange="get_city(this.value,'city')">
<option value="0">Select State</option>
</select>
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row">
<label class=""><span class="star">*</span> City </label>
<div class="inputstyle">
<img src="<?php echo base_url();?>assets/front_assets/images/ajax-loader-1.gif" style="margin: 0 0 0 20px; display:none" id="city_loader"/>
<select class="input_col2" id="city" name="city">
<option value="0">Select City/Suburb</option>
</select>
<div id="cpwd_msg" class="div_msg"></div>
</div>
</div>
<div class="form_row" id="np_register_message">
</div>
<div id="f_button" style="width:123px; height:34px; margin:0 auto; margin-top:30px;">
<img src="<?php echo base_url();?>assets/front_assets/images/button.jpg" style="width:98px;height:35px;"/>
</div>
<div id="f_bottom"></div>
</form>
</div>
</div>
</div>
But the problem is i am getting the div in this way?
How can i solve this issue. I want the div should have auto height and it will stretch automatically

If I interpret your image correctly, the div is adjusting its height automatically.
But, because you have used:
position: absolute
that div is no longer in the flow of the page. This means that elements below it can move up to overlap.
If that is the problem, there are a variety of ways to fix it depending on what the rest of the page is like.

Related

Fieldset with aligned items using bootstrap not aligned properly

I'm working on a wire frame and trying to create the HTML based on it. This is the structure I'll be require to build:
This is what I have done so far but the alignment is not correctly rendered. I have used the two column grid approach and then used the form-inline classes, however the label and text boxes are not getting aligned in one row.:
<style>
.body {
padding: 1px 1px 1px 1px;
}
.column {
float: left;
width: 50%;
}
.customLegend {
border: 1px solid #000;
padding: 2em 0 1em;
margin-top: 2em;
position: relative;
}
.customLegend legend {
border: 0;
background: #fff;
width: auto;
transform: translateY(-50%);
position: absolute;
top: 0;
left: 1em;
padding: 0 .5em;
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="container body">
<fieldset class="customLegend">
<legend>Sources</legend>
<div class="row">
<!-- Left Section -->
<div class="column">
<div class="form-inline">
<div class="form-inline">
<label>Initial Reporter </label>
<input type="text" class="form-control" />
</div>
<div class="form-inline">
<label class="lbl">First Name </label>
<input type="text" class="form-control" />
</div>
<div class="form-inline">
<label class="lbl">Phone Number </label>
<input type="text" class="form-control" />
</div>
<div class="form-inline">
<label class="lbl">Title </label>
<input type="text" class="form-control" />
</div>
<div class="form-inline">
<label class="lbl">Address </label>
<textarea class="form-control"> </textarea>
</div>
<div class="form-group">
<label class="lbl">Qualification </label>
<select class="form-control">
<option value="0"> </option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
<div class="form-group">
<label class="lbl">Primary Source </label>
<input type="checkbox" class="form-control" />
</div>
<div class="form-group">
<label class="lbl">P I Usage </label>
<select class="form-control">
<option value="0"> </option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
</div>
<!-- Right Section -->
<div class="column">
<div class="form-inline">
<div class="form-group">
<label class="lbl">Ok to Contact? </label>
<select class="form-control">
<option value="0"> </option>
<option value="1">Yes</option>
<option value="2">No</option>
</select>
</div>
<div class="form-group">
<span class="form-inline">
<label>Last Name </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>Email </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>Company </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>Country </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>Zip/Postal </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>City </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>State/Region </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>Phone Number 2 </label>
<input type="text" class="form-control" />
</span>
</div>
<div class="form-group">
<span class="form-inline">
<label>FAX </label>
<input type="text" class="form-control" />
</span>
</div>
</div>
</div>
</div>
</fieldset>
<button class="btn btn-primary">Create New Source</button>
</div>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
Check the Jsfiddle here
You need to replace the column by col-6 and the hierarchy of the bootstrap divs should change to following
<div class="container">
<div class="row">
<!-- Left Section -->
<div class="col-6">
</div>
<div class="col-6">
</div>
</div>
</div>

How to make bootstrap form-inline Horizontal scrollable

My form is way too large I want to make it scrollable without breaking line. How can I do this?
HTML:
<div id="item_group">
<div class="form-group form-md-line-input" style="">
<label>Item</label>
<select class="form-control " data-live-search="true" name="" id="" style="">
<option>Select Item</option>
<option value="23">Styler King 6 Card Holder (Set of 1, Khaki)</option>
</select>
</div>
<div class="form-group form-md-line-input" style="">
<label>Unit</label>
<select class="form-control " data-live-search="true" name="" id="" style="">
<option>Select Unit</option>
<option value="1">Piece</option>
<option value="2">Box</option>
<option value="4">Sub Box</option>
</select>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">Quantity</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">Sale Rate</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">Discount</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">CGST</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">SGST</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">IGST</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">Net Rate</label>
</div>
<div class="form-group form-md-line-input">
<input type="number" class="form-control" id="form_control_1" name="" style="" value="0">
<label for="form_control_1">Net Amount</label>
</div>
<input type="hidden" value="1" id="total_item">
<div class="col-md-12" style="padding-left: 0px; padding-right: 0px">
<div class="form-actions noborder">
<button class="btn blue" style="width: 100%;" onclick="addnewitem()"><i class="fa fa-plus"></i>Add New Item</button>
</div>
</div>
</div>
URL:
http://vsss.co.in/Admin/index.php/Sales
Inline Form Image
If you want horizontal scroll to you form, Then add this
overflow: scroll; height: 400px; to this class .portlet.light
As per your code,
.portlet.light {
padding: 12px 20px 15px;
background-color: #fff;
overflow: scroll;
height: 400px;
}

Bootstrap - checkbox left aligning issue

I Have the following bootstrap form broken into groups.
I am trying to add a checkbox but, it doesn't seem to left align correctly.
How can i make the check box left align and under the "Max Amount" ?
and i want to add radio button to the next group.
My Fiddle
<div class="panel panel-primary">
<div class="panel-heading"> Information</div>
<div class="panel-body">
<!---->
<fieldset>
<legend> Borrowing Power</legend>
<div class='row'>
<div class='col-sm-6'>
<div class='form-group'>
<label for="user_password">Desired Amount</label>
<!--<input class="form-control" id="user_password" name="user[password]" size="30" type="password" /> -->
<input name="desiredamount" id="" class="form-control input-normal desiredLoan">
</div>
</div>
<div class='col-sm-6'>
<div class='form-group'>
<label for="user_password_confirmation" class="">Max Loan Amount</label><br>
<input class="form-control pull-left" id="" name="" class="pull-left" type="checkbox" />
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Personal Information</legend>
<div class='row'>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_title">Title</label>
<input class="form-control" id="user_title" name="user[title]" size="30" type="text" />
</div>
</div>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_firstname">First name</label>
<input class="form-control" id="user_firstname" name="user[firstname]" required="true" size="30" type="text" />
</div>
</div>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_lastname">Last name</label>
<input class="form-control" id="user_lastname" name="user[lastname]" required="true" size="30" type="text" />
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-12'>
<div class='form-group'>
<label for="user_email">Email</label>
<input class="form-control required email" id="user_email" name="user[email]" required="true" size="30" type="text" />
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div class='row'>
<div class='col-sm-12'>
<div class='form-group'>
<label for="user_locale">Language</label>
<select class="form-control" id="user_locale" name="user[locale]"><option value="de" selected="selected">Deutsch</option>
<option value="en">English</option></select>
</div>
</div>
</div>
</fieldset>
<!---->
</div>
<div class="container-fluid"><!-- Row 2 -->
<!--
<div class="col-lg-4" id="userFormColumn2">
<div class="form-group">
<label for="mobile">Mobile Phone</label>
<input name="mobile" id="mobile" class="form-control input-normal">
<p class="help-block">The users mobile phone number.</p>
</div>
</div>
<div class="col-lg-4" id="userFormColumn2">
<div class="form-group">
<label for="level">User Access Level</label>
<select name="level" id="level" class="form-control input-normal">
<option value="1">1</item>
<option value="2">2</item>
</select>
<p class="help-block">The users system access level.</p>
</div>
</div> --->
<!---->
</div>
</div>
The problem is in form-control class which has width:100%
Solution
Add another class after form-control class
<input class="form-control auto-width pull-left" id="" name="" class="pull-left" type="checkbox" />
.auto-width {
width: auto;
}
Just try by removing "form-control" class from Checkbox
In this way I normally achieve it...just use column nesting
check the snippet I have nested class="col-sm-2" column inside class="col-sm-6" and added a margin-top
#check {
margin-top: -5px;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body >
<div class="panel panel-primary">
<div class="panel-heading"> Information</div>
<div class="panel-body">
<!---->
<fieldset>
<legend> Borrowing Power</legend>
<div class='row'>
<div class='col-sm-6'>
<div class='form-group'>
<label for="user_password">Desired Amount</label>
<!--<input class="form-control" id="user_password" name="user[password]" size="30" type="password" /> -->
<input name="desiredamount" id="" class="form-control input-normal desiredLoan">
</div>
</div>
<div class='col-sm-6'>
<div class='form-group'>
<label for="user_password_confirmation" class="">Max Loan Amount</label><br>
<div class='col-sm-2' id="check">
<input class="form-control pull-left" id="" name="" class="pull-left" type="checkbox" />
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Personal Information</legend>
<div class='row'>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_title">Title</label>
<input class="form-control" id="user_title" name="user[title]" size="30" type="text" />
</div>
</div>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_firstname">First name</label>
<input class="form-control" id="user_firstname" name="user[firstname]" required="true" size="30" type="text" />
</div>
</div>
<div class='col-sm-4'>
<div class='form-group'>
<label for="user_lastname">Last name</label>
<input class="form-control" id="user_lastname" name="user[lastname]" required="true" size="30" type="text" />
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-12'>
<div class='form-group'>
<label for="user_email">Email</label>
<input class="form-control required email" id="user_email" name="user[email]" required="true" size="30" type="text" />
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Options</legend>
<div class='row'>
<div class='col-sm-12'>
<div class='form-group'>
<label for="user_locale">Language</label>
<select class="form-control" id="user_locale" name="user[locale]"><option value="de" selected="selected">Deutsch</option>
<option value="en">English</option></select>
</div>
</div>
</div>
</fieldset>
<!---->
</div>
<div class="container-fluid"><!-- Row 2 -->
<!--
<div class="col-lg-4" id="userFormColumn2">
<div class="form-group">
<label for="mobile">Mobile Phone</label>
<input name="mobile" id="mobile" class="form-control input-normal">
<p class="help-block">The users mobile phone number.</p>
</div>
</div>
<div class="col-lg-4" id="userFormColumn2">
<div class="form-group">
<label for="level">User Access Level</label>
<select name="level" id="level" class="form-control input-normal">
<option value="1">1</item>
<option value="2">2</item>
</select>
<p class="help-block">The users system access level.</p>
</div>
</div> --->
<!---->
</div>
</div>
</body>
</html>
Hope this helps!

Bootstrap HTML form, not responsive

I have created an html form using bootstrap columns to get the desired layout. It's about where I want it for desktop but it piles together on mobile. I don't believe any of the code I've used is working with bootstrap. Here is the form itself:
<div class="center_div">
<div class="row">
<div class="form-group col-xs-5">
<h3>First Name</h3>
<input name="fName" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Last Name</h3>
<input name="lName" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Company Name</h3>
<input name="compName" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Business Type</h3>
<select class="form-control" style="width: 100%;" name="businessNeeds">
<option value="">Select...</option>
<option value="IntDesign">Interior Designer</option>
<option value="Ecom">E-Commerce Only</option>
<option value="Retail">Retail Store Only</option>
<option value="RetailEcom">Retail and E-Commerce</option>
<option value="Mult">Multiple Locations</option>
</select>
</div>
</div>
<div class="row">
<div class="col-xs-10">
<div class="input-group input-group-xs">
<h3>Address</h3>
<input class="form-control input-lg" name="address" type="text" />
</div>
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>City</h3>
<input name="city" type="text" />
</div>
<div class="form-group col-xs-2">
<h3>State</h3>
<select name="state">
<option value="">Select...</option>
/*Took out states for space*/
</select>
</div>
<div class="form-group col-xs-3">
<h3>Zip</h3>
<input name="zip" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Phone</h3>
<input name="phone" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Email</h3>
<input id="email" name="uemail" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-4">
<h3>Create a Username</h3>
<input name="uname" type="text" />
</div>
<div class="form-group col-xs-3">
<h3>Create a Password</h3>
<input class="form-control" style="width: 100%;" name="pass" type="password" />
</div>
<div class="form-group col-xs-3">
<h3>Confirm Password</h3>
<input class="form-control" style="width: 100%;" name="ConfPass" type="password" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Sales Tax ID</h3>
<input name="taxID" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Upload Tax ID Certificate</h3>
<input name="fileUpload" type="file" />
</div>
</div>
<div class="buttonHolder">
<input type="submit" value="Submit" /></div>
</div>
</form>
The CSS:
.center_div{
padding-left:150px;
position:relative;
width:100%;
margin:0 auto;
}
#media only screen and (max-width: 600px){
.mainForm{
}
.center_div{
width:100%;
margin:0 0 15px 0;
}
.center_div label{
width:100%;
float: none;
margin:0 0 5px 0;
}
.mainForm is a blank div around the form, there is nothing else on the page. I left the CSS pretty barebones but is there a fairly simple way to make this respond better on mobile with bootstrap? Even if all the fields just sat on top of one another.
All your bootstrap rows must be inside a .container div, otherwise they will not work as expected.
In order to stack form elements on smaller screens and have (say) two columns (6 grid columns each, really) on bigger resolutions, you need to apply two classes to your cols.
<div class="form-group col-xs-12 col-sm-6">
Essentially you're telling bootstrap that from the smallest resolution (xs) on the element should span 12 grid columns, while for small resolutions (sm) on the element should span 6 grid columns.
On this codepen I added these classes so you can see the solution at work. Hope it helps.
<html>
<head>
<title>
Mobile form responsvie
</title>
<style>
<style>
.row
{
display: flex;
flex-direction: column;
}
.form-group.col-xs-5 {
margin-left: 30px;
}
.input-inline
{
width:50%;
}
.input-inline
{
width:50%;
}
.center_div {
padding-left: 50px;
padding-right: 50px;
}
#media only screen and (max-width: 720px)
{
.input-inline
{
}
h3{
color:grey;
}
.form-group.col-xs-5
{
margin-left: 0px;
}
.center_div label{
width:100%;
float: none;
margin:0 0 5px 0;
}
.buttonolder input {
margin-left: 18%;
cursor: pointer;
}
</style>
</style>
</head>
<body>
<form>
<div class="center_div">
<div class="row">
<div class="form-group col-xs-5">
<h3>First Name</h3>
<input class="input-inline" name="fName" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Last Name</h3>
<input class="input-inline" name="lName" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Company Name</h3>
<input class="input-inline" name="compName" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Business Type</h3>
<select name="businessNeeds">
<option value="">Select...</option>
<option value="IntDesign">Interior Designer</option>
<option value="Ecom">E-Commerce Only</option>
<option value="Retail">Retail Store Only</option>
<option value="RetailEcom">Retail and E-Commerce</option>
<option value="Mult">Multiple Locations</option>
</select>
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Address</h3>
<input class="input-inline" class="form-control input-lg" name="address" type="text"/>
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>City</h3>
<input class="input-inline" name="city" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>State</h3>
<select name="state">
<option value="">Select...</option>
/*Took out states for space*/
</select>
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Zip</h3>
<input class="input-inline" name="zip" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Phone</h3>
<input class="input-inline" name="phone" type="text" />
</div>
<div class="form-group col-xs-5">
<h3>Email</h3>
<input class="input-inline" id="email" name="uemail" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Create a Username</h3>
<input class="input-inline" name="uname" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Create a Password</h3>
<input class="input-inline" class="form-control" name="pass" type="password" />
</div>
<div class="form-group col-xs-5">
<h3>Confirm Password</h3>
<input class="input-inline" class="form-control"name="ConfPass" type="password" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Sales Tax ID</h3>
<input class="input-inline" name="taxID" type="text" />
</div>
</div>
<div class="row">
<div class="form-group col-xs-5">
<h3>Upload Tax ID Certificate</h3>
<input class="upload-file" name="fileUpload" type="file" />
</div>
</div>
<div class="row">
<div class="buttonolder">
<input class="upload-file" type="submit" value="Submit" style="margin-left: 21%;margin-top: 3%;text-align: center;padding: 8px;padding-left: 27px;padding-right: 27px;cursor: pointer;">
</div>
</div>
</div>
</form>
</body>
</html>

horizontal form with inline form bootstrap while keeping everything aligned

I am trying to do an in-line form for the 123 456 789
and price fields while keeping all first label is always taking col-md-1 space and in-line with other labels.
Here is the codepen http://codepen.io/anon/pen/pEYYEj
Here is the code
<!-- Latest compiled and minified CSS & JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10" style="padding: 30px 20px 20px;
border: 1px solid #ddd;
background: #fff;">
<form data-toggle="validator" method="POST" enctype="multipart/form-data" action="/seller/new-listings" class="form-horizontal" novalidate="true">
<div class="form-group">
<label class="col-md-1 control-label">Name:</label>
<div class="col-md-11">
<input class="maxlength-handler form-control input-xlarge" data-error="Min 2 Letters" data-minlength="2" id="name" label="False" maxlength="56" name="name" required="" type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Description:</label>
<div class="col-md-11">
<textarea class="maxlength-handler form-control input-xlarge" data-error="Min 20 Letters" data-minlength="20" id="description" label="False" maxlength="300" name="description" required="" style="height:100px;"></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">123:</label>
<div class="col-md-11">
<input class="123-input form-control" id="123" maxlength="4" name="123" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">456:</label>
<div class="col-md-11">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">678:</label>
<div class="col-md-11">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1g </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1g </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/8 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/4 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/2 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1 oz </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-1"></div>
<div class="form-group">
<br>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Stock:</label>
<div class="col-md-11">
<input class="form-control only-numbers" data-error="Stock required" data-minlength="1" id="stock" maxlength="3" name="stock" placeholder="Total Available Inventory for sale measured by Gram" required="" type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Published:</label>
<div class="col-md-11"><select class="form-control" id="published" name="published"><option value="published">Published</option><option value="not_published">Unpublished</option></select></div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">SKU:</label>
<div class="col-md-11"><input class="form-control" id="sku" name="sku" type="text" value=""></div>
</div>
</form>
</div>
Not quite sure if this is what you were looking for, but if you drop some of the form-groups and change the field divs to col-md-1 too, then you get the fields you want inlined...
http://codepen.io/anon/pen/pEYYdb
<div class="form-group">
<label class="col-md-1 control-label">123:</label>
<div class="col-md-1">
<input class="123-input form-control" id="123" maxlength="4" name="123" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
<label class="col-md-1 control-label">456:</label>
<div class="col-md-1">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
<label class="col-md-1 control-label">678:</label>
<div class="col-md-1">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
.inline-inp,.inline-inp .col-md-1,.inline-inp .col-md-11{
display:inline-block;
}
<!-- Latest compiled and minified CSS & JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10" style="padding: 30px 20px 20px;
border: 1px solid #ddd;
background: #fff;">
<form data-toggle="validator" method="POST" enctype="multipart/form-data" action="/seller/new-listings" class="form-horizontal" novalidate="true">
<div class="form-group">
<label class="col-md-1 control-label">Name:</label>
<div class="col-md-11">
<input class="maxlength-handler form-control input-xlarge" data-error="Min 2 Letters" data-minlength="2" id="name" label="False" maxlength="56" name="name" required="" type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Description:</label>
<div class="col-md-11">
<textarea class="maxlength-handler form-control input-xlarge" data-error="Min 20 Letters" data-minlength="20" id="description" label="False" maxlength="300" name="description" required="" style="height:100px;"></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">123:</label>
<div class="col-md-11">
<input class="123-input form-control" id="123" maxlength="4" name="123" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">456:</label>
<div class="col-md-11">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">678:</label>
<div class="col-md-11">
<input class="cbn-input form-control" id="" maxlength="4" name="" style=" width:80px; display:inline-block; " type="text" value="0">
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1g </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1g </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/8 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/4 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1/2 </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group inline-inp">
<label class="col-md-1 control-label">Price:</label>
<div class="col-md-11">
<label class="control-label" style="padding-right:5px;">1 oz </label>
<input class="cbd-input form-control" data-error="Price required" data-minlength="1" id="price" maxlength="8" name="price" required="" style=" width:80px; display:inline-block; " type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="col-md-1"></div>
<div class="form-group">
<br>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Stock:</label>
<div class="col-md-11">
<input class="form-control only-numbers" data-error="Stock required" data-minlength="1" id="stock" maxlength="3" name="stock" placeholder="Total Available Inventory for sale measured by Gram" required="" type="text" value="">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">Published:</label>
<div class="col-md-11"><select class="form-control" id="published" name="published"><option value="published">Published</option><option value="not_published">Unpublished</option></select></div>
</div>
<div class="form-group">
<label class="col-md-1 control-label">SKU:</label>
<div class="col-md-11"><input class="form-control" id="sku" name="sku" type="text" value=""></div>
</div>
</form>
</div>