Skip to content

Set explicit enum titles for select drop down

pincher2012 edited this page Nov 16, 2014 · 1 revision

Very often, when creating a select drop-down, the text to display is different from the value to store. It is easy to achieve this with JSON Editor.All you have to do is to provide "enum_titles" in options.


Example schema:

{
  "title": "Gender",
  "type": "string",
  "enum": [
    "m",
    "f"
  ],
  "options": {
    "enum_titles": [
      "male",
      "female"
    ]
  }
}

Here, "male" and "female" are displayed, but only "m" and "f" are stored in JSON.