Components.FormGroup Class
This component renders a <div class="form-group">
element, with support for validation states and feedback icons.
Use as a block level component:
{{#bs-form-group validation=firstNameValidation}}
<label class="control-label">First name</label>
{{bs-input type="text" value=firstname}}
{{/bs-form-group}}
If the validation
property is set to some state (usually Bootstrap's predefined states "success",
"warning" or "error"), the appropriate styles will be added, together with a feedback icon.
See http://getbootstrap.com/css/#forms-control-validation
Item Index
Properties
errorIcon string
publicThe icon classes to be used for a feedback icon in a "error" validation state.
Defaults to the usual glyphicon classes. This is ignored, and no feedback icon is
rendered if useIcons
is false.
You can change this globally by setting the formValidationErrorIcon
property of
the ember-bootstrap configuration in your config/environment.js file. If your are
using FontAwesome for example:
ENV['ember-bootstrap'] = {
formValidationErrorIcon: 'fa fa-times'
}
hasFeedback boolean
publicComputed property which is true if the form group is showing a validation icon
hasValidation boolean
publicComputed property which is true if the form group is in a validation state
infoIcon string
publicThe icon classes to be used for a feedback icon in a "info" validation state.
Defaults to the usual glyphicon classes. This is ignored, and no feedback icon is
rendered if useIcons
is false.
You can change this globally by setting the formValidationInfoIcon
property of
the ember-bootstrap configuration in your config/environment.js file. If your are
using FontAwesome for example:
ENV['ember-bootstrap'] = {
formValidationInfoIcon: 'fa fa-info-circle
}
The "info" validation state is not supported in Bootstrap CSS, but can be easily added using the following LESS style:
.has-info {
.form-control-validation(@state-info-text; @state-info-text; @state-info-bg);
}
successIcon string
publicThe icon classes to be used for a feedback icon in a "success" validation state.
Defaults to the usual glyphicon classes. This is ignored, and no feedback icon is
rendered if useIcons
is false.
You can change this globally by setting the formValidationSuccessIcon
property of
the ember-bootstrap configuration in your config/environment.js file. If your are
using FontAwesome for example:
ENV['ember-bootstrap'] = {
formValidationSuccessIcon: 'fa fa-check'
}
Default: 'glyphicon glyphicon-ok'
useIcons boolean
publicWhether to show validation state icons. See http://getbootstrap.com/css/#forms-control-validation
Default: true
validation string
publicSet to a validation state to render the form-group with a validation style. See http://getbootstrap.com/css/#forms-control-validation
The default states of "success", "warning" and "error" are supported by Bootstrap out-of-the-box.
But you can use custom states as well. This will set a has-useIcons
is true)
a feedback whose class is taken from the
warningIcon string
publicThe icon classes to be used for a feedback icon in a "warning" validation state.
Defaults to the usual glyphicon classes. This is ignored, and no feedback icon is
rendered if useIcons
is false.
You can change this globally by setting the formValidationWarningIcon
property of
the ember-bootstrap configuration in your config/environment.js file. If your are
using FontAwesome for example:
ENV['ember-bootstrap'] = {
formValidationWarningIcon: 'fa fa-warning'
}