Users need to input a simple text value.
Text boxes allow the user to input a simple text value. A text box only allows for a single line of input.
<input type="text" class="form-control">
<input type="text" class="form-control" disabled>
Input masks ensure that the user understands the input format required, in addition to making input less error-prone by potentially restricting the number or types of characters that can be entered.
Example uses https://github.com/RobinHerbots/jquery.inputmask for demo purposes.
<input type="text" class="form-control" id="im1" data-inputmask="'mask': '999-99-9999'">
<input type="text" class="form-control" id="im1" data-inputmask="'mask': 'PCT/99,999,999'">
<input type="text" class="form-control" id="im1" data-inputmask="'alias': 'date'">
Users need to input an extended, potentially multi-line text value.
Text areas allow the user to input extended, multi-line text values.
Text areas can either
<textarea class="form-control" rows="2"></textarea>
Users must choose between two or more mutually exclusive options.
<div class="radio">
<label><input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>Checked</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios4" value="option4">Extended
<div class="text-muted">This option has some useful help text associated with it that elaborates on the state or purpose.</div>
</label>
</div>
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" checked> Checked
</label>
<label class="radio-inline">
<input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> Normal
</label>
Users need to specify which option(s) from a set are applicable/valid/true based on a label.
Send me weekly reminders
, vs. Do not send me weekly reminders
)<div class="checkbox">
<label><input type="checkbox" name="optionsCheckboxes" id="optionsCheckboxes1" value="option1" checked>Checked</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="optionsCheckboxes" id="optionsCheckboxes4" value="option4">
Extended
<div class="text-muted">This option has some useful help text associated with it that elaborates on the state or purpose.</div>
</label>
</div>
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox1" value="option1" checked> Checked
</label>
<label class="checkbox-inline">
<input type="checkbox" id="inlineCheckbox2" value="option2"> Normal
</label>
The user needs to choose an option from a predefined set.
Select a [type]...
or Select...
Example uses https://github.com/ivaynberg/select2 for demo purposes.
<div class="form-group">
<label for="se17" class="col-sm-3 control-label">Normal</label>
<div class="col-sm-9">
<select id="se17" class="form-control select2">
<option value="A">Option A</option>
<option value="B">Option B</option>
<option value="C">Option C</option>
</select>
</div>
</div>
This is the native browser multi-select. ctrl+click
(or cmd+click
) toggles selection on an item. shift+click
performs a range selection. A single click
sets the selection to only that item.
<div class="form-group">
<label for="se16" class="col-sm-3 control-label">Disabled</label>
<div class="col-sm-9">
<select multiple id="se16" disabled class="form-control">
<option value="A">Option A</option>
<option value="B">Option B</option>
<option value="C">Option C</option>
<option value="D">Option D</option>
</select>
</div>
</div>
Depending on the JS library used for the date picker, functionality may vary.
Date pickers can provide:
Example uses jQuery UI for demo purposes.
<div class="form-group">
<label for="dp1" class="col-sm-3 control-label">Date</label>
<div class="col-sm-9">
<span class="input-icon icon icon-calendar-o"></span>
<input id="dp1" data-inputmask="'mask': 'm/d/y', 'placeholder': 'mm/dd/yyyy'" type="text" class="datepicker form-control" >
</div>
</div>
<div class="form-group">
<label for="dp2" class="col-sm-3 control-label">Range</label>
<div class="col-sm-9">
<div class="row">
<div class="col-sm-6">
<span class="input-icon icon icon-calendar-o"></span>
<input id="dp2" placeholder="From" data-inputmask="'mask': 'm/d/y', 'placeholder': 'mm/dd/yyyy'" type="text" class="datepicker form-control" >
</div>
<div class="col-sm-6">
<span class="input-icon icon icon-calendar-o"></span>
<input id="dp3" placeholder="To" data-inputmask="'mask': 'm/d/y', 'placeholder': 'mm/dd/yyyy'" type="text" class="datepicker form-control" >
</div>
</div>
</div>
</div>