Generating HTML forms from JSON or XML feed using JQuery

I've found some of these that might help you:

Generating forms from JSON schema:

  • how to create a html form using a JSON definition?
  • http://neyric.github.com/inputex/examples/json-schema.html
  • JavaScript to generate/render dynamic HTML form from JSON or similar data?
  • Any tool to generate html form

Generating forms from an XML schema:

  • http://www.totallysmartit.com/examples/xml/questionnaire/
  • Create HTML form from XML
  • http://www.datamech.com/XMLForm/

Samples from different libraries to generate form:

  • http://www.alpacajs.org/examples.html
  • http://jsonforms.io/#/examples
  • http://schemaform.io/examples/bootstrap-example.html

Just to give you another choice, a library I created:

https://github.com/brutusin/json-forms

JSON Schema to HTML form generator, supporting dynamic subschemas (on the fly resolution). Extensible and customizable library with zero dependencies. Bootstrap add-ons provided

 var bf = brutusin["json-forms"].create({
  "$schema": "http://json-schema.org/draft-03/schema#",
  "type": "object",
  "properties": {
    "s1": {
      "type": "string",
      "title": "A string",
      "description": "A string input"
    },
    "num1": {
      "type": "integer",
      "title": "A number",
      "minimum": 1,
      "maximum": 10,
      "multipleOf": 3,
      "description": "An integer multiple of `3`, between `1` and `10` (inclusive)"
    },
    "array1": {
      "type": "array",
      "title": "An array values",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          }
        }
      }
    }
  }
});
var container = document.getElementById('container');
bf.render(container);
<link rel="stylesheet" href='https://cdn.jsdelivr.net/brutusin.json-forms/1.3.2/css/brutusin-json-forms.min.css'/>
<link rel="stylesheet" href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'/>
<script src="https://code.jquery.com/jquery-1.12.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/brutusin.json-forms/1.3.2/js/brutusin-json-forms.min.js"></script>
<script src="https://cdn.jsdelivr.net/brutusin.json-forms/1.3.2/js/brutusin-json-forms-bootstrap.min.js"></script>
<div id="container"></div>
<hr>
<button class="btn btn-primary" onclick="alert(JSON.stringify(bf.getData(), null, 4))">getData()</button>&nbsp;<button class="btn btn-primary" onclick="if (bf.validate()) {alert('Validation succeeded')}">validate()</button>

More live examples at http://brutusin.org/json-forms

Tags:

Xml

Jquery

Json