TextField
| Extends | FieldBase |
|---|---|
| Namespace | Limbo.Forms.Models.Fields |
| Type | text |
The TextField class represents a HTML <input /> element with it's type attribute set to text.
Properties
The class extends the InputField class, thus inheriting it's properties from both InputField and FieldBase. TextField doesn't have any properties of it's own.
| C# Name | C# Type | JSON Name | Description |
|---|---|---|---|
Type |
string |
type |
Inherited from the FieldBase class.The type of the field - generally matching the HTML |
Name |
string |
name |
Inherited from the FieldBase class.The name of the field - matching the value for the HTML `name` attribute. |
Label |
string |
label |
Inherited from the FieldBase class.A friendly name that should accompany the field. |
Description |
string |
description |
Inherited from the FieldBase class.A description that should accompany the field. |
IsRequired |
bool |
required |
Inherited from the FieldBase class.Whether the field is required/mandatory. |
Value |
object |
value |
Inherited from the FieldBase class.An optional value of the field. |
Placeholder |
string |
placeholder |
Inherited from the InputField class.The value for the HTML placeholder attribute.
|
Pattern |
bool |
pattern |
Inherited from the InputField class.The value for the HTML pattern attribute (aka a REGEX pattern used to validate the field).
|
Size |
int? |
size |
Inherited from the InputField class.The value for the HTML size attribute.
|
JSON Output
{
"type": "text",
"name": "textField",
"label": "Text field",
"description": "Please enter a text.",
"required": true,
"placeholder": "Your text here",
"pattern": "bb|[^b]{2}",
"size": 64,
"value": "Hello World"
}