Problem in saving a calendar date

sudhakar940

I setup a test button on one of my forms to call “form.clear();” and it works as expected with the files provided by Darya.

flembopa

   could u please give me a sample code snipet

i have attached the code
calendar.zip (60.3 KB)

this is a simplified version of my form but the “clear” button still works - if you fill in the fields including the two calendar items and then hit “clear” it will blank all of the fields.

Obviously you will need to change the path to your DHTMLX files.

I suspect that you may have accidentally kept the path to one of the older versions of the files updated by Darya (very easily done).

form clear test
</head>
<body onload="doOnLoad();">
    <div id="parentId" style="position: relative; top: 20px; left: 20px; width: 1200px; height: 600px; aborder: #B5CDE4 1px solid;"></div>
    <script>
        var appFormStructure, appForm;
        function doOnLoad() {
            dhtmlx.skin = "dhx_skyblue";
            window.dhx_globalImgPath = "../dhtmlxv3/dhtmlxCombo/codebase/imgs/";
                appFormStructure = [
                    {type:"settings",position:"label-left", labelWidth:"150", inputWidth:"200"},
        		{type:"input", name:"name", label: 'Name:', validate:"NotEmpty"},
		{type:"input", name:"description", label: 'Description:'},
                    {type:"input", name:"speed", label: "Network Speed" },
                    {type:"input", name:"install_cost", label: "Installation Cost"},
                    {type:"input", name:"annual_cost", label: "Annual Cost"},
                    {type:"calendar", name:"start_date", label: "Start Date", dateFormat:"%d-%m-%Y", serverDateFormat:"%Y-%m-%d"},
                    {type:"calendar", name:"end_date", label: "End Date", dateFormat:"%d-%m-%Y", serverDateFormat:"%Y-%m-%d"},
                    {type: "button",value: "Save",name: "send"}, 
                    {type: "button",value: "clear",name: "clear"} 
               ];

                appForm = new dhtmlXForm("parentId",appFormStructure);

                appForm.attachEvent("onButtonClick", function(id) {
                  if (id == "send") {
                        appForm.save();
                    }
                    if (id == "clear") {
                        appForm.clear();
                    }
                });
        };

    </script>    
</body>

flembopa,

i copied the code and executed with the library provided by darya but still the calendar value is clear when i cliked the clear button... i also attache my whole code in the previous post....

I looked at your zip and I am using the version of dhtmlxcalendar.js that Darya posted on 29th March NOT the one from 30th March. My version is 57Kb and yours is 49Kb.
I suggest that you try the previous version.

Darya - are there any plans to include some kind of version numbering in the files to help keep track of them?

There are files from 2012:
download/file.php?id=4778
To all: use it all please )))

Thank u darya atlast it worked

sudhakar940
Excellent!!!