formbuilder
formbuilder copied to clipboard
Add a flexible option
I would like to write a question like this:
What is your favorite kind of ice cream?
[ ] chocolate
[ ] vanilla
[ ] other (please specify) ____________
At present, the "option list" only lets you put in fixed values, so this isn't possible yet.
I have no idea how I would describe this thing in a JSON schema. Any idea?
I might be possible using an array with multiple types also what most form do is to add an other selection with a comment input after.
It's not amazing, but how about:
{
"type": "object",
"title": "Untitled form",
"description": "Enter some description for your form here",
"properties": {
"question_1": {
"title": "Question 1",
"oneOf": [
{
"type": "string",
"enum": [
"option 1",
"option 2",
"option 3"
]
},
{
"type": "string",
"title": "Other (please specify)"
}
]
}
}
}