Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Add a flexible option #133

Open
glasserc opened this issue Jun 22, 2016 · 3 comments
Open

Add a flexible option #133

glasserc opened this issue Jun 22, 2016 · 3 comments
Milestone

Comments

@glasserc
Copy link

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.

@almet
Copy link
Member

almet commented Jun 22, 2016

I have no idea how I would describe this thing in a JSON schema. Any idea?

@Natim
Copy link
Member

Natim commented Jun 22, 2016

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.

@glasserc
Copy link
Author

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)"
        }
      ]
    }
  }
}

@almet almet added this to the v2 milestone Oct 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants