DHTMLX Docs & Samples Explorer

### Button Test

Source

    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">

        <script src="../../codebase/dhtmlxcommon.js"></script>
        <script src="../../../dhtmlxWindows/codebase/dhtmlxcontainer.js"></script>

        <link rel="stylesheet" type="text/css" href="../../../dhtmlxWindows/codebase/dhtmlxwindows.css">
        <link rel="stylesheet" type="text/css" href="../../../dhtmlxWindows/codebase/skins/dhtmlxwindows_dhx_skyblue.css">

        <script src="../../../dhtmlxWindows/codebase/dhtmlxcommon.js"></script>

        <script src="../../../dhtmlxWindows/codebase/dhtmlxwindows.js"></script>

        <link rel="stylesheet" type="text/css" href="../../../dhtmlxTabbar/codebase/dhtmlxtabbar.css">
        <script src="../../../dhtmlxTabbar/codebase/dhtmlxtabbar.js"></script>

        <script src="../../codebase/dhtmlxform.js"></script>

        <style>
            html, body {
                width: 100%;
                height: 100%;
                margin: 0px;
                overflow: hidden;
            }
        </style>

        <div id="listObj" style="position: relative; width: 250px;"></div>
        <script>var dhxWins,
    w1,
    tabbar,
    dhxList;
    function doOnLoad() {

        var formData = [{
            type: "label",
            label: "dhtmlxList"
        }, {
            type: "radio",
            name: "choose",
            value: "online",
            label: "Will enjoy the online demo"
        }, {
            type: "radio",
            name: "choose",
            value: "senddisk",
            label: "Please send me disk",
            checked: true,
            list: [{
                type: "checkbox",
                name: "bootleg",
                value: "yes",
                label: "Insert bootleg",
                checked: true
            }, {
                type: "checkbox",
                name: "lirycs",
                value: "jaja",
                label: "Lyrics if possible",
                checked: true
            }, {
                type: "label",
                label: "Payment"
            }, {
                type: "radio",
                name: "paymenttype",
                value: "creditcard",
                label: "Credit Card",
                list: [{
                    type: "input",
                    name: "cardnumber",
                    value: "XXXX-XXXX-XXXX-XXXX",
                    label: "Card Number"
                }, {
                    type: "input",
                    name: "cardkey",
                    value: "XXXX",
                    label: "Key"
                }]
                }, {
                type: "radio",
                name: "paymenttype",
                value: "cash",
                label: "Cash",
                checked: true
            }, {
                type: "label",
                label: "Currency"
            }, {
                type: "radio",
                name: "currencytype",
                value: "dollar",
                label: "U. S. Dollars",
                checked: true
            }, {
                type: "radio",
                name: "currencytype",
                value: "euro",
                label: "Euro"
            }, {
                type: "radio",
                name: "currencytype",
                value: "brb",
                label: "Belarusian Rubel"
            }, {
                type: "select",
                name: "mediatype",
                label: "Select Media Type",
                options: [{
                    value: "1",
                    text: "CD 700Mb",
                    list: [{
                        type: "checkbox",
                        name: "overburn",
                        value: "yes_1",
                        label: "Overburn",
                        checked: true
                    }]
                    }, {
                    value: "2",
                    text: "DVD5 4.4Gb",
                    list: [{
                        type: "checkbox",
                        name: "lightscribe",
                        value: "yes",
                        label: "Light Scribe",
                        checked: true
                    }, {
                        type: "checkbox",
                        name: "labelflash",
                        value: "yes",
                        label: "Label Flash",
                        checked: false,
                        list: [{
                            type: "radio",
                            name: "labelflash_radio",
                            value: "required",
                            label: "Required",
                            checked: true
                        }, {
                            type: "radio",
                            name: "labelflash_radio",
                            value: "not_mandatory",
                            label: "Not bad option"
                        }]
                        }]
                    }, {
                    value: "3",
                    text: "DVD9 8.6Gb",
                    selected: true,
                    list: [{
                        type: "radio",
                        name: "86dvd",
                        value: "86dvd_1",
                        label: "Double Layer",
                        checked: true
                    }, {
                        type: "radio",
                        name: "86dvd",
                        value: "86dvd_2",
                        label: "Two-Sided"
                    }]
                    }, {
                    value: "4",
                    text: "Blue-Ray 24Gb"
                }]
                }, {
                type: "select",
                name: "audioquality",
                label: "Select Audio Quality",
                options: [{
                    value: "1",
                    text: "2.0 16bit/128kbps"
                }, {
                    value: "2",
                    text: "2.1 16bit/334kbps"
                }, {
                    value: "3",
                    text: "5.1 32bit/448kbps",
                    selected: true
                }]
                }, {
                type: "select",
                name: "videoquality",
                label: "Select Video Quality",
                options: [{
                    value: "1",
                    text: "DVD MPEG-2",
                    selected: true
                }, {
                    value: "2",
                    text: "DivX"
                }, {
                    value: "3",
                    text: "XviD"
                }]
                }, {
                type: "input",
                name: "comments",
                label: "Comments",
                value: "Some Comments",
                rows: 3
            }, {
                type: "checkbox",
                name: "upload",
                label: "Upload your cover for disk",
                list: [{
                    type: "file",
                    name: "file_a",
                    label: "Preview"
                }, {
                    type: "file",
                    name: "file_b",
                    label: "Full-Size Image"
                }]
                }]
            }, {
            type: "button",
            name: "btn2",
            value: "Submit",
            command: "reset"
        }
    ];

        var formData2 = [{
            type: "label",
            label: "What do you think about form?"
        }, {
            type: "radio",
            name: "what_do_you_think_about_form",
            value: "yes",
            label: "I like it!",
            checked: true
        }, {
            type: "radio",
            name: "what_do_you_think_about_form",
            value: "great",
            label: "dhtmlxForm is really great!"
        }, {
            type: "radio",
            name: "what_do_you_think_about_form",
            value: "no",
            label: "I don't like it!"
        }, {
            type: "button",
            name: "btn2",
            value: "Send"
        }];

        dhxWins = new dhtmlXWindows();
        dhxWins.setImagePath("../../../dhtmlxWindows/codebase/imgs/");

        w1 = dhxWins.createWindow("w1", 10, 10, 420, 370);
        w1.setText("Preferences");

        tabbar = w1.attachTabbar();
        tabbar.setImagePath("../../../dhtmlxTabbar/codebase/imgs/");
        tabbar.addTab("a1", "General", 100);
        tabbar.addTab("a2", "Update", 100);
        tabbar.addTab("a3", "Encryption", 100);
        tabbar.setTabActive("a1");

        dhxList = tabbar.cells("a1").attachForm(formData);
        dhxList = tabbar.cells("a2").attachForm(formData2);

    }</script>