Supported Form Controls

Bootstrap provides the following form controls:

Options include input, 

  • textarea, 
  • checkbox, 
  • radio button, 
  • and select.

Bootstrap Input

Bootstrap supports all of the HTML5 input types, including text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.

Inputs will NOT be fully styled if their type is not correctly defined!

------list mukava -----

The sample below includes two input elements, one of type text and one of type password:

Example

				
					<div class="form-group">
  <label for="usr">Name:</label>
  <input type="text" class="form-control" id="usr">
</div>
<div class="form-group">
  <label for="pwd">Password:</label>
  <input type="password" class="form-control" id="pwd">
</div>
				
			

Bootstrap Textarea

------list mukava -----

The following example has a textarea:

Example

				
					<div class="form-group">
  <label for="comment">Comment:</label>
  <textarea class="form-control" rows="5" id="comment"></textarea>
</div>
				
			

Bootstrap Checkboxes

------list mukava -----

Checkboxes are used when you want the user to select multiple selections from a list of preset alternatives.

The following example includes three checkboxes. The final option is disabled.

Example

				
					<div class="checkbox">
  <label><input type="checkbox" value="">Option 1</label>
</div>
<div class="checkbox">
  <label><input type="checkbox" value="">Option 2</label>
</div>
<div class="checkbox disabled">
  <label><input type="checkbox" value="" disabled>Option 3</label>
</div>
				
			

To have the checkboxes show on the same line, use the.checkbox-inline class:

------list mukava -----

Example

				
					<label class="checkbox-inline"><input type="checkbox" value="">Option 1</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 2</label>
<label class="checkbox-inline"><input type="checkbox" value="">Option 3</label>
				
			

Bootstrap Radio Buttons

------list mukava -----

Radio buttons are used when you wish to limit the user to only one option from a collection of preset selections.

The following example includes three radio buttons. The first option is checked by default, while the last option is disabled:

Example

				
					<div class="radio">
  <label><input type="radio" name="optradio" checked>Option 1</label>
</div>
<div class="radio">
  <label><input type="radio" name="optradio">Option 2</label>
</div>
<div class="radio disabled">
  <label><input type="radio" name="optradio" disabled>Option 3</label>
</div>
				
			

To make the radio buttons display on the same line, use the.radio-inline class:

------list mukava -----

Example

				
					<label class="radio-inline"><input type="radio" name="optradio" checked>Option 1</label>
<label class="radio-inline"><input type="radio" name="optradio">Option 2</label>
<label class="radio-inline"><input type="radio" name="optradio">Option 3</label>
				
			

Bootstrap Select List

------list mukava -----

Select lists are used when you want the user to choose from a variety of options.

The example below includes a dropdown list (select list):

Example

				
					<div class="form-group">
  <label for="sel1">Select list:</label>
  <select class="form-control" id="sel1">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
  </select>
</div>
				
			
Share this Doc

BS Inputs

Or copy link

Explore Topic