Form field layout issue with Bootstrap 3 - html

I'm a bit of a novice when it comes to Bootstrap and I'm struggling to get some form fields to conform to my desired layout. My sample snippet of HTML code is here:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Registration</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
</head>
<body>
<form id="frmRegister" class="form-horizontal">
<div id="divContainer" class="container-fluid" style="width: 90%">
<h2 id="h2Registration" style="background-color: #F76803; color: white; margin: 3px 3px 3px 3px"></h2>
<div id="divChild1">
<div class="form-group">
<label for="txtChildLastName1" class="control-label col-xs-1">Last Name *</label>
<div class="col-xs-3">
<input type="text" class="form-control" id="txtChildLastName1" maxlength="25" />
</div>
<label for="txtChildFirstName1" class="control-label col-xs-1">First Name *</label>
<div class="col-xs-3">
<input type="text" class="form-control" id="txtChildFirstName1" maxlength="25" />
</div>
<label for="txtChildMiddleInit1" class="control-label col-xs-1">Initial</label>
<div class="col-xs-1">
<input type="text" class="form-control" id="txtChildMiddleInit1" maxlength="1" />
</div>
<label for="txtChildSuffix1" class="control-label col-xs-1">Suffix</label>
<div class="col-xs-1">
<input type="text" class="form-control" id="txtChildSuffix1" maxlength="5" />
</div>
</div>
<div class="form-group">
<label for="groupGender" class="control-label col-xs-1">Gender *</label>
<div class="col-xs-2">
<label class="radio-inline">
<input type="radio" name="groupGender1" id="rbGenderMale1" value="M" />Male
</label>
<label class="radio-inline">
<input type="radio" name="groupGender1" id="rbGenderFemale1" value="F" />Female
</label>
</div>
<label for="txtChildDOB1" class="control-label col-xs-1">DOB *</label>
<div class="col-xs-1">
<input type="date" class="form-control dateTextBox" style="position: absolute; z-index: 999" id="txtChildDOB1" name="txtChildDOB1" value="" />
</div>
<label for="txtDoctorName1" class="control-label col-xs-1">Doctor Name</label>
<div class="col-xs-3">
<input type="text" class="form-control" id="txtDoctorName1" maxlength="50" />
</div>
<label for="txtDoctorPhone1" class="control-label col-xs-1">Doctor Phone</label>
<div class="col-xs-2">
<input type="text" class="form-control" id="txtDoctorPhone1" maxlength="50" />
</div>
</div>
<div class="form-group">
<label for="txtAthleteDues1" class="control-label col-xs-1">Registration Fee</label>
<div class="col-xs-1 input-group">
<div class="input-group-addon">$</div>
<input type="text" class="form-control" id="txtAthleteDues1" placeholder="85" maxlength="2" />
</div>
<label for="txtUniform1" class="control-label col-xs-1">Uniform</label>
<div class="col-xs-2">
<input type="text" class="form-control" id="txtUniform1" maxlength="50" placeholder="Estimate size, if needed" />
</div>
<label for="txtUniformFee1" class="control-label col-xs-1">Uniform Fee</label>
<div class="col-xs-1 input-group">
<div class="input-group-addon">$</div>
<input type="text" class="form-control" id="txtUniformFee1" placeholder="80" maxlength="2" />
</div>
</div>
<div class="form-group">
<label for="txtAthleteFees1" class="control-label col-xs-1">Athlete Fees</label>
<div class="col-xs-11">
<input type="text" class="form-control" id="txtAthleteFees1" disabled="disabled" value="Some descriptive text goes here" />
</div>
</div>
</div>
</div>
</form>
</body>
</html>
The culprit appears to be my use of the input-group/input-group-addon classes which prepend the field with the dollar sign (Registration Fee). The result is that the subsequent fields for Uniform and Uniform Fee wrap to the next row rather than appearing inline on the same row with Registration Fee. The first two rows, which don't use input-group/input-group-addon do not have this problem.

Instead of using col-* and input group together, put the input-group inside the col-* like this..
<div class="col-xs-1">
<div class="input-group">
<div class="input-group-addon"> .. </div>
http://www.bootply.com/g6rtaYL4fy

Related

HTML - moving <div> container below to one below without breaking other <div> containers [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am trying to move my "Seller" container right below my "Corporation Store" container. I added a visual presentation.
I tried using clear:bothand clear:left; however, it was messing the other containers: "Customer" and "Product".
So, I tried putting the "Seller" container into a new row and tried using clear:both to put the "Seller" container below "Corporation" container.
Because the "Customer" container is big, it creates a huge gap between "Seller" and "Corporation" containers. Is there a way I can fix this problem or approach this problem different?
Thank you
jsfiddle
I achieved what your end result by wrapping both "Corporation Store" and "Seller ID" in their own "col-xs-3" container and then stripping them of that same class.
<!DOCTYPE html>
<html>
<head>
<title>Corp Simulator</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<link rel="stylesheet" href="../css/sweetalert2.min.css">
<link rel="stylesheet" href="../css/home.css">
</head>
<body>
<!-- navigation -->
<nav class="navbar navbar-default">
<!-- container -->
<div class="container">
<!-- header -->
<div class="navbar-header">
<div class="col-xs-12 navbar-header-padding">
<span class="col-xs-3"><img src="../img/corp-logo-flat.png"/></span>
<span class="col-xs-9"><a class="navbar-brand">Corp Simulator</a><a type="button" data-toggle="modal" data-target="#buildModal" class="label label-default pull-right ">Build</a></span>
</div>
</div>
</div>
</nav>
<!-- begin content -->
<div class="col-sm-12">
<div class="col-xs-8">
<!-- corporation -->
<div class="col-xs-12">
<h2>Corporation</h2>
<!-- begin form -->
<form id="cForm">
<!-- begin row -->
<div class="row">
<div class="col-xs-3">
<!-- corporation store -->
<div>
<div class="panel panel-default">
<div class="panel-heading">Corporation Store</div>
<div class="panel-body">
<div class="col-xs-12 no-left-right-padding">
<div class="col-xs-6 no-right-padding">
<div class="form-group">
<label for="corpId">Corporation ID #</label>
<input type="text" class="form-control" tabindex="1" name="corpId" id="corpId" schoolId="corpId">
</div>
</div>
</div>
<div class="form-group">
<label for="startDate">Start Date</label>
<input type="datetime-local" class="form-control" tabindex="2" name="startDate" id="startDate" placeholder="Start Date">
</div>
<div class="form-group">
<label for="endTime">End Time</label>
<input type="datetime-local" class="form-control" tabindex="3" name="endTime" id="endTime" placeholder="End Time">
</div>
</div>
</div>
</div>
<!-- seller info -->
<div>
<div class="panel panel-default">
<div class="panel-heading">Seller ID</div>
<div class="panel-body">
<div class="form-group">
<label for="sellerId">SE ID</label>
<input type="text" class="form-control" tabindex="4" name="sellerId" id="sellerId" placeholder="SE ID">
</div>
<div class="form-group">
<label for="seFirstName">SE First Name</label>
<input type="text" class="form-control" tabindex="5" name="seFirstName" id="seFirstName" placeholder="SE First Name">
</div>
<div class="form-group">
<label for="seLastName">SE Last Name</label>
<input type="text" class="form-control" tabindex="6" name="seLastName" id="seLastName" placeholder="SE Last Name">
</div>
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>
<!--customer -->
<div class="col-xs-6">
<div class="panel panel-default">
<div class="panel-heading">Customer</div>
<div class="panel-body">
<div class="col-xs-6">
<div class="form-group">
<label for="customerId">Customer ID</label>
<input type="text" class="form-control" tabindex="7" name="customerId" id="customerId" placeholder="Customer ID">
</div>
<div class="form-group">
<label for="companyName">Company Name</label>
<input type="text" class="form-control" tabindex="9" name="companyName" id="companyName" placeholder="Company Name">
</div>
<div class="form-group">
<label for="customerFirstName">First Name</label>
<input type="text" class="form-control" tabindex="11" name="customerFirstName" id="customerFirstName" placeholder="First Name">
</div>
<div class="form-group">
<label for="customerAddress1">Address 1</label>
<input type="text" class="form-control" tabindex="13" name="customerAddress1" id="customerAddress1" placeholder="Address 1">
</div>
<div class="form-group">
<label for="customerCity">City</label>
<input type="text" class="form-control" tabindex="15" name="customerCity" id="customerCity" placeholder="City">
</div>
<div class="form-group">
<label for="customerPostalCode">Postal Code</label>
<input type="text" class="form-control" tabindex="17" name="customerPostalCode" id="customerPostalCode" placeholder="Postal Code">
</div>
<div class="form-group">
<label for="customerPhone1">Phone 1</label>
<input type="text" class="form-control" tabindex="19" name="customerPhone1" id="customerPhone1" placeholder="Phone 1">
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label for="relationshipType">Relationship</label>
<input type="text" class="form-control" tabindex="8" name="relationship" id="relationship" placeholder="Relationship">
</div>
<div class="form-group">
<label for="nationalId">National Identifier</label>
<input type="text" class="form-control" tabindex="10" name="nationalId" id="nationalId" placeholder="National ID">
</div>
<div class="form-group">
<label for="customerLastName">Last Name</label>
<input type="text" class="form-control" tabindex="12" name="customerLastName" id="customerLastName" placeholder="Last Name">
</div>
<div class="form-group">
<label for="customerAddress2">Address 2</label>
<input type="text" class="form-control" tabindex="14" name="customerAddress2" id="customerAddress2" placeholder="Address 2">
</div>
<div class="form-group">
<label for="customerState">State/Province</label>
<input type="text" class="form-control" tabindex="16" name="customerState" id="customerState" placeholder="State/Province">
</div>
<div class="form-group">
<label for="customerCountryCode">Country Code</label>
<input type="text" class="form-control" tabindex="18" name="customerCountryCode" id="customerCountryCode" placeholder="Country Code">
</div>
<div class="form-group">
<label for="customerPhone2">Phone 2</label>
<input type="text" class="form-control" tabindex="20" name="customerPhone2" id="customerPhone2" placeholder="Phone 2">
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label for="customerEmail">Email</label>
<input type="email" class="form-control" tabindex="22" name="customerEmail" id="customerEmail" placeholder="Email">
</div>
</div>
</div>
</div>
</div>
<!-- product -->
<div class="col-xs-3">
<div class="panel panel-default">
<div class="panel-heading">Product</div>
<div class="panel-body">
<div class="form-group">
<label for="prodId">Product ID</label>
<input type="text" class="form-control" tabindex="23" name="prodId" id="prodId" placeholder="PRODUCT ID">
</div>
<div class="form-group">
<label for="modelYear">Year</label>
<input type="text" class="form-control" tabindex="24" name="modelYear" id="modelYear" placeholder="Year">
</div>
<div class="form-group">
<label for="model">Model</label>
<input type="text" class="form-control" tabindex="25" name="model" id="model" placeholder="Model">
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</form>
<!-- end form -->
</div>
</div>
</div>
</body>
</html>
The snippet is limited in its view, but you will see the layout you wanted to achieve.

how to design in bootstrap textbox and lable without space

i need some help for front end side. i have below picture i want to design form like below picture in bootstrap but in bootstrap how do this please help check my below html.
<div class="col-sm-2">
<label>Flight No</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
<div class="col-md-2">
<div class="form-group">
<label>Departure Date</label>
<input type="text" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label for="exampleInputEmail1">D/Time</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Arrival Date</label>
<input type="email" class="form-control" placeholder="Sub-Agent Name">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label>A/Time</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Arrival Sector</label>
<input type="text" style="width: 20px;" class="form-control" placeholder="Voucher No">
<input type="text" style="width: 30px;" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Terminal</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
i want like this
my bootstrap
Need to Update with this CSS and HTML. It's Responsive so you can check properly. I hope this one help you.
.form-group,
.form-group label,
.form-group input { float:left; display:inline; }
input{
width:100px;
}
label{
padding:5px;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="row">
<form class="form-inline">
<label>Flight No</label>
<input type="text" class="form-control" placeholder="Agent Name" >
<div class="form-group">
<label>Departure Date</label>
<input type="text" class="form-control" placeholder="Voucher No">
</div>
<div class="form-group">
<label for="exampleInputEmail1">D/Time</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Arrival Date</label>
<input type="email" class="form-control" placeholder="Sub-Agent Name">
</div>
<div class="form-group">
<label>A/Time</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
<div class="form-group">
<label>Arrival Sector</label>
<input type="text" style="width: 20px;" class="form-control" placeholder="Voucher No">
<input type="text" style="width: 30px;" class="form-control" placeholder="Voucher No">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Terminal</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</form>
</div>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<style type="text/css">
#media (min-width: 768px){
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
display: inline-flex;
}
}
</style>
</head>
<body>
<div class="col-md-12 form-inline">
<div class="col-md-2" style="display: inline-flex;">
<label>Flight No</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
<div class="col-md-2">
<div class="form-group">
<label>Departure Date</label>
<input type="text" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label for="exampleInputEmail1">D/Time</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Arrival Date</label>
<input type="email" class="form-control" placeholder="Sub-Agent Name">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label>A/Time</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Arrival Sector</label>
<input type="text" style="width: 20px;" class="form-control" placeholder="Voucher No">
<input type="text" style="width: 30px;" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Terminal</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
</div>
</body>
</html>
label {
margin-bottom: .5rem;
display: contents !important;
}
.form-control {
display: initial !important;
width: auto !important;}
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="col-sm-2">
<label>Flight No</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
<div class="col-md-2">
<div class="form-group">
<label>Departure Date</label>
<input type="text" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label for="exampleInputEmail1">D/Time</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Arrival Date</label>
<input type="email" class="form-control" placeholder="Sub-Agent Name">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<label>A/Time</label>
<input type="text" class="form-control" placeholder="Agent Name">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Arrival Sector</label>
<input type="text" style="width: 20px;" class="form-control" placeholder="Voucher No">
<input type="text" style="width: 30px;" class="form-control" placeholder="Voucher No">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="exampleInputEmail1">Terminal</label>
<input type="email" class="form-control" placeholder="Reference">
</div>
</div>
</body>
</html>

Text field in same line HTML

How to make multiple text fields in the same line.
This is my code:
<div class="col-lg-2">
<div class="form-group">
<label>Working experience</label>
<input type="text" class="form-control " placeholder="Year"/>Year
<input type="text" class="form-control " placeholder="Month"/>Month
<input type="text" class="form-control " placeholder="Day" />Day
</div>
</div>
It's by default. input is inline element.
<div class="col-lg-2">
<div class="form-group">
<label>Working experience</label>
<input type="text" class="form-control " placeholder="Year" />Year
<input type="text" class="form-control " placeholder="Month" />Month
<input type="text" class="form-control " placeholder="Day"
Day
</div>
</div>
In bootstrap you can put all of the fields that you want on a single line within a single form-group
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group">
<label for="birthday" class="col-xs-3 col-sm-2 control-label">Birthday</label>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="year"/>
</div>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="month"/>
</div>
<div class="col-xs-3">
<input type="text" class="form-control" placeholder="day"/>
</div>
</div>
It seems, you are using Bootstrap, if yes, then;
Add class .form-inline to the <form> element.
else, Add these css properties to <form>,
display: inline-block;
width: auto;
You can try this way too.
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="col-lg-2">
<div class="form-group" >
<label style="width:25%; float:left;">Working experience</label>
<div style="width:25%; float:left;">
<input type="text" class="form-control " placeholder="Year"/>Year
</div>
<div style="width:25%; float:left;">
<input type="text" class="form-control " placeholder="Month"/>Month
</div>
<div style="width:25%; float:left;">
<input type="text" class="form-control " placeholder="Day"/>Day
</div>
</div>
</div>
</body>
</html>
Use Bootstrap:
<form class="form-inline" action="/action_page.php">
<label>Working experience : </label>
<div class="form-group">
<input type="text" class="form-control" id="year" placeholder="Year" name="year">
</div>
<div class="form-group">
<input type="text" class="form-control" id="month" placeholder="Month" name="month">
</div>
<div class="form-group">
<input type="text" class="form-control" id="day" placeholder="Day" name="day">
</div>
</form>
You could use inline form class.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<form class="form-inline">
<div class="form-group">
<label>Working experience</label>
<input type="text" class="form-control" placeholder="Year">
<input type="text" class="form-control" placeholder="Month">
<input type="text" class="form-control " placeholder="Day">
</div>
</form>
Use Expand snippet to see actual result.

Bootstrap align form textfields

I'm new to Bootstrap and am trying to create a simple form with 13 fields.
I am using inline since I want to display the fields next to each other (Label: Textbox)
It is working fine on mobile device (listed one under the other which is OK) but on PC it does not appear ordered. How can I align the fields in three columns for example to make them look ordered on PC browser. This is my current output:
http://upupa.byethost10.com/session1.html#
My code as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Session Details</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Session Details</h2>
<p></p>
<form class="form-inline" role="form">
<div class="form-group">
<label for="date">Date:</label>
<input type="date" class="form-control" id="date" placeholder="Date">
</div>
<div class="form-group">
<label for="Site">Site:</label>
<div class="form-group">
<select id="Site" name="Site" class="form-control">
<option value="1">Xaghra</option>
<option value="2">Option two</option>
<option value="">Populated by database</option>
</select>
</div>
</div>
<div class="form-group">
<label for="ringer">Ringer:</label>
<input type="text" class="form-control" id="ringer" placeholder="Ringer">
</div>
<div class="form-group">
<label for="Net Length">Net Length:</label>
<input type="number" class="form-control" id="Net Length" placeholder="Net Length">
</div>
<div class="form-group">
<label for="Net Remarks">Net Remarks:</label>
<input type="text" class="form-control" id="Net Remarks" placeholder="Net Remarks">
</div>
<div class="form-group">
<label for="Tape Lure 1">Tape Lure 1:</label>
<input type="text" class="form-control" id="Tape Lure 1" placeholder="Tape Lure 1">
</div>
<div class="form-group">
<label for="Tape Lure 2">Tape Lure 2:</label>
<input type="text" class="form-control" id="Tape Lure 2" placeholder="Tape Lure 2">
</div>
<div class="form-group">
<label for="Tape Lure 3">Tape Lure 3:</label>
<input type="text" class="form-control" id="Tape Lure 3" placeholder="Tape Lure 3">
</div>
<div class="form-group">
<label for="Remarks">Remarks:</label>
<input type="text" class="form-control" id="Remarks" placeholder="Remarks">
</div>
<div class="form-group">
<label for="Cloud Cover">Cloud Cover:</label>
<input type="text" class="form-control" id="Cloud Cover" placeholder="Cloud Cover">
</div>
<div class="form-group">
<label for="Wind Direction">Wind Direction:</label>
<input type="text" class="form-control" id="Wind Direction" placeholder="Wind Direction">
</div>
<div class="form-group">
<label for="Wind Strength">Wind Strength:</label>
<input type="number" class="form-control" id="Wind Strength" placeholder="Wind Strength">
</div>
<div class="form-group">
<label for="Rain">Rain:</label>
<input type="text" class="form-control" id="Rain" placeholder="Rain">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
thanks
You need to put the inputs that you want grouped together into rows using <div class="row"> and each form-group into columns with (for example) <div class="col-md-4">.
I did this for your first set of three inputs here: http://jsfiddle.net/jonmrich/bz59xucp/
Check into the documentation for Bootstrap to see how to use rows and columns effectively.

Inline Bootstrap form layout with labels above inputs

I'd like to create a form with the following layout using Bootstrap 3:
I have a jsfiddle with an attempt here: http://jsfiddle.net/quyB6/
And the markup I've tried:
<form>
<div class="form-group col-md-4">
<label for="name" class="control-label">Line Height</label>
<input type="number" value='' class="form-control" id="lineHeight">
</div>
<div class="form-group col-md-4">
<label for="name" class="control-label">Padding Top</label>
<input type="number" value='' class="form-control" id="paddingTop" />
</div>
<div class="form-group col-md-4">
<label for="name" class="control-label">Padding Bottom</label>
<input type="number" value='' class="form-control" id="paddingBottom">
</div>
</div>
I think the simplest solution would be to add col-xs-4 to the class of each div. That will make sure the divs will be inline for the jsfiddle example. Additionally, you should close the form tag with </form>.
<form>
<div class="form-group col-xs-4 col-md-4">
<label for="name" class="control-label">Line Height</label>
<input type="email" value='' class="form-control" id="name" placeholder="Ime">
</div>
<div class="form-group col-xs-4 col-md-4">
<label for="name" class="control-label">Padding Top</label>
<input type="email" value='' class="form-control" id="name" placeholder="Ime">
</div>
<div class="form-group col-xs-4 col-md-4">
<label for="name" class="control-label">Padding Bottom</label>
<input type="email" value='' class="form-control" id="name" placeholder="Ime">
</div>
</form>
For bootstrap v4 you can use d-flex flex-column:
<div class="form-group col-md-4">
<div class="d-flex flex-column">
<label for="name" class="control-label">Line Height</label>
<input type="number" value='' class="form-control" id="lineHeight">
</div>
</div>
With Bootstrap 4.4:
Use the class "form-row" in the form element.
<form class="form-row">
<div class="form-group col-md-4">
<label for="name" class="control-label">Line Height</label>
<input type="number" value='' class="form-control" id="lineHeight">
</div>
<div class="form-group col-md-4">
<label for="name" class="control-label">Padding Top</label>
<input type="number" value='' class="form-control" id="paddingTop" />
</div>
<div class="form-group col-md-4">
<label for="name" class="control-label">Padding Bottom</label>
<input type="number" value='' class="form-control" id="paddingBottom">
</div>
</form>
Replace <label> tag with <div> and it will line up on top perfectly.
Putting <div style="clear: both;"></div> between the <label> and the <input> worked for me. I tried a bunch of the above ideas with no luck. This is with Bootstrap 3.3.7.
So
<label for="name" class="control-label">Line Height</label>
<div style="clear: both;"></div>
<input type="number" value='' class="form-control" id="lineHeight">
I also included "pull-right" as a class (i.e. class="control-label pull-right" and class="form-control pull-right" to get the label and the input on the right-hand side of the page.
this will work:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap 4 Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<form>
<div class="row">
<div class="col-md-4">
<label for="name" class="control-label">Line Height</label>
</div>
<div class="col-md-4">
<label for="name" class="control-label">Padding Top</label>
</div>
<div class="col-md-4">
<label for="name" class="control-label">Padding Bottom</label>
</div>
</div>
<div class="row">
<div class="col-md-4">
<input type="number" value='' class="form-control bg-secondary text-white" id="lineHeight">
</div>
<div class="col-md-4">
<input type="number" value='' class="form-control bg-secondary text-white" id="paddingTop" />
</div>
<div class="col-md-4">
<input type="number" value='' class="form-control bg-secondary text-white" id="paddingBottom">
</div>
</div>
</div>
</body>
</html>
check:https://jsfiddle.net/89h0vrLq/