Form
The Form component is a container that dispatches an event with all its containing field values.
Examples
Simple form
Here is a basic Form component example:
{
"type": "form",
"onSubmit": {
"_type": "listener",
"name": "myListener",
},
"child": {
"type": "flex",
"children": [
{
"type": "textfield",
"value": "",
"name": "myField"
},
{
"type": "textfield",
"value": "",
"name": "secondField"
},
{
"type": "button",
"text": "Send",
"submit": true
}
]
}
}
The myListener
listener will be triggered with an event containing the next data:
{
"myField": "The first field value",
"secondField": "The second field value"
}
Properties
Attribute | Description | Type |
---|---|---|
_type | The type of the element |
|
child | Any component | Component |
onSubmit | Callback when the user submits the form. | Listener |