As initial data we'll take the following form:
In JSON the data will look as:
[ {type: "fieldset", name: "data", label: "Welcome", inputWidth: "auto", list:[ {type:"input", name: "name", label:"Login"}, {type:"password", name:"pass", label:"Password"}, {type:"button", name:"save", value:"Proceed"}] } ]
welcome(json).html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="codebase/skins/dhtmlxform_dhx_skyblue.css"> <script src="codebase/dhtmlx.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="codebase/dhtmlx.css"> </head> <body onload="doOnLoad()"> <div id="form_container" style="width:250px;height:300px;"></div> <script> var myForm, formData; function doOnLoad() { formData = [ { type: "fieldset", name: "data", label: "Welcome", inputWidth: "auto", list:[ {type:"input", name: 'name', label:'Login'}, {type:"password", name:"pass", label:"Password"}, {type:"button", name:"save", value:"Proceed"}] } ] myForm = new dhtmlXForm("form_container", formData); } </script> </body> </html>