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.
25 lines • 427 B
JSON
{
"schema": {
"text": {
"type": "string",
"title": "Text"
}
},
"form": [
{
"key": "text",
"onChange": function (evt) {
var value = $(evt.target).val();
if (value) alert(value);
}
},
{
"type": "button",
"title": "Click me",
"onClick": function (evt) {
evt.preventDefault();
alert('Thank you!');
}
}
]
}