Our next step is to add a form on the page.
To create a form, we'll need:
We will specify the following controls in the form:
"index.html" file
<html>
<head>
<title>dhtmlxForm. Server side</title>
<link rel="stylesheet" type="text/css" href="codebase/dhtmlx.css">
<script src="codebase/dhtmlx.js"></script>
<div id="box" style="width:250px; height:160px; background-color:white;"> </div> </head>
<body>
<script> //the code of the application
</script>
</body>
</html>
"index.html" file
formData = [
{type: "block", list:[
{type:"fieldset", label:"Customer details", width:267, list:[
{type:"input", name:"name", label: "Name", labelWidth:50},
{type:"input", name:"address", label: "Address", labelWidth:50},
{type:"input", name:"email", label: "Email", labelWidth:50},
{type:"button",name:"save", offsetTop:10, value:"Submit"}
]}]},
{type:"block", list:[
{type:"button", name:"button1", value:"Customer 1", offsetTop:10},
{type:"newcolumn"},
{type:"button", name:"button2", value:"Customer 2", offsetTop:10}
]}
];
"index.html" file
var myform = new dhtmlXForm("box",formData);//object constructor