Timeinput - smbc-digital/form-builder GitHub Wiki
DSL properties
Property |
Type |
Required |
Default Value |
Description |
QuestionId |
string |
✔️ |
❌ |
Unique question id allowed charatcers are [a-zA-Z] only |
Label |
string |
✔️ |
❌ |
Label associated with the search term |
Warning |
string |
❌ |
❌ |
Warning which appears above the input NOTE: Only use one of Warning, Hint or IAG |
Hint |
string |
❌ |
❌ |
Hint which appears above the input NOTE: Only use one of Warning, Hint or IAG |
IAG |
string |
❌ |
❌ |
Inset text to appear below the Label. NOTE: Only use one of Warning, Hint or IAG |
Optional |
bool |
❌ |
false |
|
OptionalIf |
Condition |
❌ |
❌ |
A condition that can be used to determine if the element is optional by comparing it to an earlier answer |
CustomValidationMessage |
string |
❌ |
❌ |
Set a custom validation message for when user does not enter a time. |
CustomValidationMessageAmPm |
bool |
❌ |
false |
Set a custom validation message for when user does not select am or pm. |
ValidationMessageInvalidTime |
bool |
❌ |
false |
Set a custom validation message for when user does not enter a valid time |
TargetMapping |
string |
❌ |
❌ |
Used for custom object mapping when creating submit data |
StrongLabel |
bool |
❌ |
true |
Labels associated to inputs are strong |
LegendAsH1 |
bool |
❌ |
false |
Display the input's label as a h1 and not a legend (if this is set to true, HideTitle in the Page properties should also be set to true) |
MaxLength |
int |
❌ |
2 |
Set max length for the input field |
SummaryLabel |
string |
❌ |
❌ |
Change the label associated with this input on the summary |
Time input examples
DS Json for single time input on a page
{
"Title": "Page 1",
"PageSlug": "page1",
"HideTitle": false,
"Elements": [
{
"Type": "TimeInput",
"Properties": {
"QuestionId": "timeid",
"LegendAsH1": true,
"Label": "What time did it happen?",
}
}
]
}
DS Json for time input
{
"Type": "TimeInput",
"Properties": {
"QuestionId": "timeid",
"Label": "What time did it happen?"
}
}
All possible properties example:
{
"Type": "TimeInput",
"Properties": {
"QuestionId": "timeid",
"Warning": "This thing that you want to do, should be done with care",
"LegendAsH1": true,
"Label": "What time did it happen?",
"StrongLabel": true,
"Hint": "For example, 10:30 AM",
"IAG": "inset text example",
"CustomValidationMessage": "This field is required",
"ValidationMessageInvalidTime": "Enter a valid time",
"CustomValidationMessageAmPm": "You must choose AM or PM",
"MaxLength": "4",
"TargetMapping": "customer.time",
"Optional": false
}
}