<html> <head> <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script> <script src="src/jquery.jsForm.controls.js"></script> <script src="src/jquery.jsForm.js"></script> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/> <script> $(function(){ // some json data var jsonData = { name: "TestName", // standard inputs props: { active: true, // checkbox groups: [{ name: "Base", priority: 0, tasks: [{ id:0, name: "base task1", priority: 1}, {id:1,name: "base task0", priority: 0}, {id:2,name: "base task2", priority: 2}] }, { name: "Important", priority: 2, tasks: [{id:0, name: "imp task1", priority: 1}, {id:1,name: "imp task0", priority: 0}] }, { name: "Other", priority: 1, tasks: [{id:0, name: "other", priority: 1}] }] }, state: "VISIBLE" // selects (enums) }; // initialize the form, prefix is optional and defaults to data $("#details").jsForm({ data:jsonData }); $("#show").click(function() { // show the json data alert(JSON.stringify($("#details").jsForm("get"), null, " ")); }); }); </script> </head> <body> <h1>Multi level array testform</h1> <div id="details"> Name: <input name="data.name"/><br/> <input type="checkbox" name="data.props.active"/> active<br/> <select name="data.state"> <option value="VISIBLE">visible</option> <option value="IMPORTANT">important</option> <option value="HIDDEN">hidden</option> </select> <div class="collection sort" data-field="data.props.groups" data-sort="priority"> <fieldset> <legend>Group: <span class="field">groups.name</span></legend> <ul class="collection sort reorder" data-field="groups.tasks" data-sort="priority"> <li><input name="tasks.name"/></li> </ul> <button class="sortUp">up</button> <button class="sortDown">down</button> </fieldset> </div> </div> <button id="show">Show Object</button> </body> </html>