DHTMLX Docs & Samples Explorer

Send

Source
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxform.js"></script>
<script>
var myForm,
formData;
function doOnLoad() {
    formData = [{
        type: "settings",
        position: "label-left",
        labelWidth: 100,
        inputWidth: 120
    }, {
        type: "fieldset",
        label: "Welcome",
        inputWidth: "auto",
        list: [{
            type: "input",
            label: "Package",
            name: "Package",
            value: ""
        }, {
            type: "input",
            label: "Version",
            name: "Version",
            value: ""
        }, {
            type: "input",
            label: "Maintainer",
            name: "Maintainer",
            value: ""
        }, {
            type: "input",
            label: "Size",
            name: "Size",
            value: ""
        }, {
            type: "checkbox",
            label: "Text",
            name: "Test",
            value: "abc"
        }, {
            type: "button",
            value: "Load set 1",
            name: "set1"
        }, {
            type: "button",
            value: "Load set 2",
            name: "set2"
        }, {
            type: "button",
            value: "Load set 3",
            name: "set3"
        }, {
            type: "button",
            value: "Send",
            name: "send"
        }]
        }];
    myForm = new dhtmlXForm("myForm", formData);
    myForm.attachEvent("onButtonClick", function(id) {
        if (id == "set1");
        myForm.load('php/data.php?id=1');
        if (id == "set2");
        myForm.load('php/data.php?id=2');
        if (id == "set3");
        myForm.load('php/data.php?id=5');
        if (id == "send");
        myForm.send('php/mirror.php', function(loader, response) {
            alert(response);
        });
    });
}
</script> <div id="myForm" style="height:260px;"></div>