FormControl
in namespace DotVVM.Bootstrap5.Controls
Represents a single element in the Form control.
Usage & Scenarios
The FormControl (known as FormGroup in Boostrap4) is used inside the Form control and renders a form field with a label.
Sample 1: Basic Usage
The FormControl
control can render a label for any child control placed inside it.
Consider using some existing controls that combine FormControl with the most popular form elements:
<bs:FormControl LabelText="Feedback" HelpText="You can describe it in a few sentences.">
<bs:TextBox Type="MultiLine" Text="{value: 'Test'}" />
</bs:FormControl>
Properties
Name | Type | Description | Notes | Default Value | |
---|---|---|---|---|---|
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
Content | DotvvmControl | Gets or sets the inner form element. |
inner element
static value
default
|
null | |
ControlSizeAll | String | Gets or sets the size of the control for all screen sizes. |
attribute
static value
|
null | |
ControlSizeLarge | String | Gets or sets the size of the control for large screen sizes. |
attribute
static value
|
null | |
ControlSizeMedium | String | Gets or sets the size of the control for medium screen sizes. |
attribute
static value
|
null | |
ControlSizeSmall | String | Gets or sets the size of the control for small screen sizes. |
attribute
static value
|
null | |
ControlSizeXLarge | String | Gets or sets the size of the control for extra large screen sizes. |
attribute
static value
|
null | |
ControlSizeXXLarge | String | Gets or sets the size of the control for extra extra large screen sizes. |
attribute
static value
|
null | |
DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. The DataContext is null in client-side templates. |
attribute
bindable
|
null | |
FormControlCssClass | String | Gets or sets the CSS class to apply to the form control element. |
attribute
static value
|
null | |
FormControlType | FormControlType? | Gets or sets the available form control type. |
attribute
static value
|
null | |
HelpContent | List<DotvvmControl> | Gets or sets a custom template for for the help text. Cannot be combined with a `HelpText` property. |
inner element
static value
|
null | |
HelpText | String | Gets or sets a plain text for the help text. Cannot be combined with a `HelpContent` property. |
attribute
static value
bindable
|
null | |
ID | String | Gets or sets the control client ID within its naming container. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
LabelContent | List<DotvvmControl> | Gets or sets a custom template for for the control label. Cannot be combined with a `LabelText` property. |
inner element
static value
|
null | |
LabelSizeAll | String | Gets or sets the size of the label for all screen sizes. |
attribute
static value
|
null | |
LabelSizeLarge | String | Gets or sets the size of the label for large screen sizes. |
attribute
static value
|
null | |
LabelSizeMedium | String | Gets or sets the size of the label for medium screen sizes. |
attribute
static value
|
null | |
LabelSizeSmall | String | Gets or sets the size of the label for small screen sizes. |
attribute
static value
|
null | |
LabelSizeXLarge | String | Gets or sets the size of the label for extra large screen sizes. |
attribute
static value
|
null | |
LabelSizeXXLarge | String | Gets or sets the size of the label for extra extra large screen sizes. |
attribute
static value
|
null | |
LabelText | String | Gets or sets a plain text for the control label. Cannot be combined with a `LabelContent` property. |
attribute
static value
bindable
|
null | |
LabelType | LabelType? | Gets or sets the label type. Possible values are `Default` and `Floating`. |
attribute
static value
|
null | |
Layout | FormControlLayout? | Gets or sets the form control layout. Possible values are `Default`, `Horizontal` and `Grid`. |
attribute
static value
|
null | |
RenderLabel | Boolean? | Gets or sets whether the label is rendered. |
attribute
static value
|
null | |
Size | Size? | Gets or sets the size of the label and form control elements. |
attribute
static value
|
null |