Bootstrap align inputs side by side - html

I am trying to align two inputs side by side using bootstrap. Testing of regular divs as follows works great:
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
</div>
But this always pushes to the second input below the first.
<div class="row">
<div class="col-md-2 input-group">
<span class="input-group-addon">Income $</span>
<input type="number" id="income" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
<div class="col-md-2 col-md-offset-2 input-group">
<span class="input-group-addon">Mortgage Payment $</span>
<input type="number" id="mortgagepayment" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
</div>
Any clues?

As in given HTML there is no <form> element.
here is the
Demo using .controls-row and .control-group
<div class="container">
<div class="controls-row row">
<div class="control-group col-md-6">
<div class="input-group">
<span class="input-group-addon">Income $</span>
<input type="number" id="income" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
</div>
<div class="control-group col-md-6">
<div class="input-group">
<span class="input-group-addon">Mortgage Payment $</span>
<input type="number" id="mortgagepayment" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
</div>
</div>
</div>

You should use the "form-inline" Bootstrap class to achieve this:
<form class="form-inline">
<div class="form-group">
<div class="form-group">
<div class="input-group" style="width: 220px;">
<span class="input-group-addon">Income $</span>
<input type="number" id="income" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
</div>
<div class="form-group">
<div class="input-group" style="width: 250px;">
<span class="input-group-addon">Mortgage Payment $</span>
<input type="number" id="mortgagepayment" class="form-control" placeholder="0">
<span class="input-group-addon">.00</span>
</div>
</div>
</div>
</form>
Take a look at it HERE

I think you've asked a sort of loaded question, but I'll do my best to help.
After following the BS3.x docs online, I noticed you didn't wrap your form elements in a form-x class. That usually helps with their custom CSS for form elements. Following BS convention, you're missing an outer wrapper form-group. Lastly, because your beginning label(s) are different lengths (ie Mortgage Payment), wrapping them in a grid container .col-md-2 might not render the way you intend. Regardless, changing the column class is easy to do, so that is for you to decide. Remember that BS has media queries, so how it shows for you might be different depending on device and viewport width.
All that said, I've got this fiddle that should help you.
HTML
<div class="container">
<div class="row">
<form class="form-inline">
<div class="form-group col-md-6">
<div class="input-group">
<span class="input-group-addon">Income $</span><input type="number" class="form-control" /><span class="input-group-addon">.00</span>
</div>
</div>
<div class="form-group col-md-6">
<div class="input-group">
<span class="input-group-addon">Mortgage Payment $</span><input type="number" class="form-control" /><span class="input-group-addon">.00</span>
</div>
</div>
</form>
</div>
http://jsfiddle.net/5webN/

Related

Reduce size of input with Bootstrap (CSS)

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>

Bootstrap weird Margin Behavior in Rows

I'm creating a form on my event management system website to allow you to create events. The page is using Bootstrap on the Admin-LTE template.
I have split part of the form into two columns. On the right column is a section to enter the number of spaces on the event and on the left is a section to enter the start and end date and time of the event. I wrote the HTML code for the right side first and am now trying to do the left side, however for some reason the space between the bootstrap rows on the page has changed despite the only different between each side is changing the check box to a number input (I will eventually add a datepicker drop down to this, however the same issue occurred when I tried it previously) and a few others changes in the naming of inputs.
Any suggestions to fix it would be very appreciated!
<div class="box box-primary">
<div class="box-body">
<div class="input-group">
<span class="input-group-addon">Event Title</span>
<input type="text" class="form-control" placeholder="Event Title" id="txtEventTitle">
</div>
<br>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<span class="input-group-addon">Start Date</span>
<input type="number" class="form-control" placeholder="Start Date" id="dteEStart">
</div>
</div>
<div class="col-lg-6">
<div class="input-group">
<span class="input-group-addon">Start Time</span>
<input type="number" class="form-control" placeholder="Start Time" id="timeEStart">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<span class="input-group-addon">End Date</span>
<input type="number" class="form-control" placeholder="End Date" id="dteEEnd">
</div>
</div>
<div class="col-lg-6">
<div class="input-group">
<span class="input-group-addon">End Time</span>
<input type="number" class="form-control" placeholder="End Time" id="timeEEnd">
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-lg-8">
<div class="input-group">
<span class="input-group-addon">Male Spaces</span>
<input type="number" class="form-control" placeholder="Event Title" id="numEMaleS">
</div>
</div>
<div class="col-lg-4">
<div class="checkbox"><label><input type="checkbox" id="cbxEMaleS">Unlimited Spaces</label></div>
</div>
</div>
<div class="row">
<div class="col-lg-8">
<div class="input-group">
<span class="input-group-addon">Female Spaces</span>
<input type="number" class="form-control" placeholder="Event Title" id="numEFemaleS">
</div>
</div>
<div class="col-lg-4">
<div class="checkbox"><label><input type="checkbox" id="cbxEFemaleS">Unlimited Spaces</label></div>
</div>
</div>
</div>
</div>
</div>
</div>
I've switched the way my rows and columns are organised, so that each side is assigned into a row before the left or right columns and therefore the height of the checkboxes will also affect the left side of the page. I then decided to re-order them so it made a bit more sense.
<div class="row">
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon">Start Date</span>
<input type="number" class="form-control" placeholder="Start Date" id="dteEStart">
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon">Start Time</span>
<input type="number" class="form-control" placeholder="Start Time" id="timeEStart">
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon">End Date</span>
<input type="number" class="form-control" placeholder="End Date" id="dteEEnd">
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon">End Time</span>
<input type="number" class="form-control" placeholder="End Time" id="timeEEnd">
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon">Male Spaces</span>
<input type="number" class="form-control" placeholder="Event Title" id="numEMaleS">
</div>
</div>
<div class="col-md-2">
<div class="checkbox"><label><input type="checkbox" id="cbxEMaleS">Unlimited Spaces</label></div>
</div>
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon">Female Spaces</span>
<input type="number" class="form-control" placeholder="Event Title" id="numEFemaleS">
</div>
</div>
<div class="col-md-2">
<div class="checkbox"><label><input type="checkbox" id="cbxEFemaleS">Unlimited Spaces</label></div>
</div>
</div>

Placing image beside form (with rows)

Note: Using bootstrap
Here is what I am going for:
Code:
<!DOCTYPE>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<style>
.jumbotron
{
margin-top: 20px;
}
.input-group, textarea
{
margin-bottom: 10px;
}
</style>
<body>
<div class = "container">
<div class = "jumbotron text-center">
<h2>Form</h2>
</div>
<form>
<div class = "row">
<div class = "col-md-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">First Name:</span>
<input type="text" class="form-control" placeholder="First Name" aria-describedby="basic-addon1">
</div>
</div>
<div class = "col-md-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Last Name:</span>
<input type="text" class="form-control" placeholder="Last Name" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-2">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Age:</span>
<input type="text" class="form-control" placeholder="Age" aria-describedby="basic-addon1">
</div>
</div>
<div class = "col-md-2">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Gender:</span>
<input type="text" class="form-control" placeholder="Gender" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Email Address:</span>
<input type="text" class="form-control" placeholder="Email Address" aria-describedby="basic-addon1">
</div>
</div>
<div class = "col-md-4">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Phone Number:</span>
<input type="text" class="form-control" placeholder="Phone Number" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class = "row">
<div class = "col-md-8">
<textarea class="form-control" rows="3" placeholder = "Additional comments"></textarea>
</div>
</div>
<div class = "row">
<div class = "col-md-2">
<button type="button" class="btn btn-default btn-lg">Submit</button>
</div>
</div>
</form>
</div>
</body>
</html>
Demo fiddle
I'm trying to place an image alongside my form as shown in figure 1.
I've tried various ways: ie. columns within columns, fluid containers etc.
Using these ways has resulted in the text boxes getting shorter and a big margin between the form and image.
It seems that the rows take up 100% width of the container and width can't be adjusted by using CSS
Any ideas on how to do this?
Also how would I center the form? Can't seem to do that also using methods that work with other elements
You just need a nested row structure. The outer columns are wrappers for the form structure and the image. The inner columns that contain your form themselves add up to 12.
Fiddle
Note that I've converted all columns to XS for the demo, and that the two short ones don't fit well at small screen sizes.
.row > div {
margin: 5px 0;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></link>
<div class="container">
<div class="jumbotron text-center">
<h2>Form</h2>
</div>
<div class="row">
<div class="col-xs-8">
<form>
<div class="row">
<div class="col-xs-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">First Name:</span>
<input type="text" class="form-control" placeholder="First Name" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-xs-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Last Name:</span>
<input type="text" class="form-control" placeholder="Last Name" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Age:</span>
<input type="text" class="form-control" placeholder="Age" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-xs-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Gender:</span>
<input type="text" class="form-control" placeholder="Gender" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Email Address:</span>
<input type="text" class="form-control" placeholder="Email Address" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-xs-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Phone Number:</span>
<input type="text" class="form-control" placeholder="Phone Number" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<textarea class="form-control" rows="3" placeholder="Additional comments"></textarea>
</div>
</div>
<div class="row">
<div class="col-xs-2">
<button type="button" class="btn btn-default btn-lg">Submit</button>
</div>
</div>
</form>
</div>
<div class="col-xs-4">
<img class="img-responsive" src="http://placehold.it/800x600" />
</div>
</div>
</div>
You should use Bootstrap's grid classes and divide your <form> section and image section into two parts.
Look at this Codepen.
Hope this helps!
I let you here a fiddle working.
.jumbotron {
margin-top: 20px;
}
.input-group,
textarea {
margin-bottom: 10px;
}
img{width:100%}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<body>
<div class="container">
<div class="jumbotron text-center">
<h2>Form</h2>
</div>
<form>
<div class="row">
<div class="col-md-9">
<div class="row">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">First Name:</span>
<input type="text" class="form-control" placeholder="First Name" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Last Name:</span>
<input type="text" class="form-control" placeholder="Last Name" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Age:</span>
<input type="text" class="form-control" placeholder="Age" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Gender:</span>
<input type="text" class="form-control" placeholder="Gender" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Email Address:</span>
<input type="text" class="form-control" placeholder="Email Address" aria-describedby="basic-addon1">
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">Phone Number:</span>
<input type="text" class="form-control" placeholder="Phone Number" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<textarea class="form-control" rows="3" placeholder="Additional comments"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-4">
<button type="button" class="btn btn-default btn-lg">Submit</button>
</div>
</div>
</div>
<div class="col-md-3">
<img src="http://txtbits.com/wp-content/uploads/2015/07/bootstrap.png">
</div>
</div>
</form>
</div>
The thing here is that you should understand that Bootstrap use a grid system made by 12 columns. When you declare a row, you have to keep in mind that it has 12 gaps to fill with your columns.
To implement a layout like yours, you shouldn't try to fit an element, like your image, which takes several rows height. In spite of that, it's better to create two columns, one for the inputs and another one for the image. Then inside the filed's column, just add as many rows as you need and fill then with the necessary columns, always keeping in mind that you have to fill 12 gaps.
You just have to take one row and two columns(or you can add divide manually with col-6) and bootstrap will adjust its width andenter image description here with div, you can add one form and your image each side and it will pop up perfectly.

How to make bootstrap form filed to 100 percent in width

I have two col divs in a row with each having two text filed while re-sizing in mobile the width of the textbox is not going to 100% and looking ugly.
Below is my bootstrap code, but in select filed the width is looks OK ..
here is the demo link see the 'Name' and 'Phone' field
http://www.responsinator.com/?url=webapplications.co.in%2Fdiamovitcarhire.com%2Fget-a-quote.html
<div class="row">
<div class="input-daterange input-group" id="datepicker">
<div class="col-md-6 col-sm-12 col-lg-6" >
<div class="form-group">
<label for="Name">Name </label>
<div class="input-group">
<input class="input-md form-control" name="Name" type="text">
</div>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="form-group">
<label for="phone">Phone </label>
<div class="input-group">
<input class="input-md form-control" name="phone" type="text">
</div>
</div>
</div>
</div>
</div>
What you probably want is something like this:
<div class="container">
<div class="row">
<div class="col-md-6" >
<div class="form-group">
<label for="Name">Name </label>
<input class="form-control" name="Name" type="text">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="phone">Phone </label>
<input class="form-control" name="phone" type="tel">
</div>
</div>
</div>
</div>
If you use that structure it should work like you described it.
Most likely you are using 'container' as your base. According to Bootstrap's site (search for 'container-fluid') the container-fluid class is the one setting div to full width of your viewport.

Responsive canvas extends beyond div

I am using ChartJS to place a responsive chart within a div. I am also using bootstrap, so the div class is grid focused (ex. md-9). The chart keeps expanding beyond the div. I was considering overflow: hidden on the div but don't want to lose any data from being shown. Here is a link to my development site. Any assistance is appreciated:
http://investingcalculator.azurewebsites.net
My current HTML code:
<div class="budgetcalcsection">
<div class="row">
<div class="col-sm-3 col-md-2">
<div class="inputtext">
Current Balance
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="number" id="currentbalance" class="form-control" placeholder="0">
</div>
</div>
<div class="inputtext">
Interest Rate
<div class="input-group">
<span class="input-group-addon">%</span>
<input type="number" id="interestrate" class="form-control" placeholder="0">
</div>
</div>
<div class="inputtext">
Monthly Contributions
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="number" id="monthlycontribution" class="form-control" placeholder="0">
</div>
</div>
<div class="inputtext">
Years Contributing
<div class="input-group">
<span class="input-group-addon">+</span>
<input type="number" id="yearscontributing" class="form-control" placeholder="0">
</div>
</div>
<div class="">
<input class="btn btn-default" type="submit" id="calculate" value="Calculate">
</div>
<div class="">
<input class="btn btn-default" type="submit" id="reset" value="Reset">
</div>
<div class="inputtext">
Ending Balance
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="text" id="endingbalance" class="form-control" placeholder="0" readonly>
</div>
</div>
</div>
<!-- Investing Chart -->
<div class="col-sm-9 col-md-10">
<canvas id="canvas"></canvas>
</div>
</div>
</div>
The problem stems from the fact that ChartJS doesn't take into account that the display-box on your elements is border-box. It is sizing the chart to the full width of the div without taking into account the padding.
In order to fix it, just put a div without any bootstrap column classes inside your column and target that with ChartJS.