jsonform
Version:
Client-side JavaScript library that generates HTML forms from structured data models expressed using a JSON schema, possibly completed by a form layout description.
43 lines • 719 B
JSON
{
"schema": {
"choice": {
"type": "string",
"enum": [ "text", "cat" ]
},
"text": {
"type": "string",
"title": "Text"
},
"category": {
"type": "string",
"title": "Category",
"enum": [
"Geography",
"Entertainment",
"History",
"Arts",
"Science",
"Sports"
]
}
},
"form": [
{
"type": "selectfieldset",
"key": "choice",
"title": "Make a choice",
"titleMap": {
"text": "Search by text",
"cat": "Search by category"
},
"items": [
"text",
"category"
]
},
{
"type": "submit",
"value": "Submit"
}
]
}