Form configuration - available fields
Button
download PDF example:
{
"mode": "PDF",
"pdf_action":"download",
"question_label": "{questionLabel}",
"answer_label":"{answerLabel}",
...
}
submit form example:
{
"mode":"submit"
...
}
clone fields example:
{
"mode": "clone",
"clone_additional_shift": -1,
"clone_fields": [
{
"id": "textField1"
},
{
"id": "textField2"
}
],
...
}
mode
submit
This mode allows you to send a form. It has no additional configuration options.
clone
This mode was created so that any number of fields can be copied. Imagine you are creating a form where someone has to add their cars (we don't know how many cars there are).
Thanks to this solution, the person filling in the form can click the button to copy any number of fields.
Full example:
{
"size": "s12 m6",
"type": "text",
"id": "carModel",
"label": "Car",
"icon": "drive_eta",
"validate": [
"required"
],
"hidden": false,
"value": ""
},
{
"size": "s12 m6",
"type": "text",
"id": "carType",
"label": "Registration number",
"icon": "directions_bus",
"validate": [
"required"
],
"hidden": false,
"value": ""
},
{
"size": "s12 m12 center",
"type": "button",
"id": "clone_btn",
"mode": "clone",
"label": "Add next car",
"clone_additional_shift": -2,
"clone_fields": [
{
"id": "carModel"
},
{
"id": "carType"
}
]
}
}
clone_additional_shift
Where are the new cloned fields to appear. Enter the number of fields from the button e.g. -1, then the fields will appear before the button.
The mechanism takes both positive and negative numbers.
clone_fields
List of cloned fields. Here you give a list with the ID of the fields you want to copy.
redirect