after call '$$("form").clear()',datapicker display1900-01-01

download dhtmlx_touch_v1.2 from site ,open samples,in 02_form,01_init.html,
after call ‘$$(“form”).clear()’,datapicker display 01.01.1900?why?i not change dataformat property.i know default property is " %d.%m.%Y".
thanks!!!

Form Minsk London 18 Check filght 2 3 right 1k 0 i1 0 1
	<script type="text/javascript" charset="utf-8">
	
	
	var ui = dhx.ui({
			
			rows:[
					{ 	view:"toolbar", type:"MainBar", elements:[
							{ view:"button", label: 'Clear', click:"clear_form" },
							{ view:"button", label: 'Set', click:"set_form" },
							{ view:"button", label: 'Get', click:"get_form" },
							{ view:"button", label: 'Parse from XML', click:"parse_xml" }
						]
					},
					{ cols:[
						
					{ 	view:"form",width:320, id:"myform", elements:[
						    { view:"textarea", id:'field_ta', label: "Notes", height:60 },
							{ view:"text", id:'field_a', label: 'from', value: "Moscow"},
							{ view:"text", id:'field_b', label: 'to', 	value: "Guatemala"},
							{ view:"counter", id:'field_c', value: 1, min: 1, max: 20, 
								label: 'passengers 12+', labelPosition:'left' },
							{ view:"richselect", id:'field_e', label: 'Type', value: "1", yCount:"3", options:[
									{ value:"1", label:"One"   },
									{ value:"2", label:"Two"   },
									{ value:"3", label:"Three" }
							]},
							{ view:"combo", id:'field_m', label: 'Combo', value:"One", yCount:"3", options:["One", "Two", "Three"]},
							[b]{ view:"datepicker", label: 'Date', id:'field_f', value:new Date(2010,7,5)},[/b]								{ view:"toggle", id:'field_g', options: ["Roundtrip","Oneway"], align: "center" },
							{ view:"radio", id:'field_i', value:"2", labelWidth:250, height:84, options:[
								{ label:"only direct flights", value: "1" },
								{ label:"any flights", value: "2" }
							]},
                            { type:"clean",
                                cols:[
                                    { view:"checkbox", id:'field_j', labelWidth:100, label:"find hotels", value: 1},
                                    { view:"checkbox", id: "field_k", labelWidth:100, label:"find car here"}
                                ]
                            },
							{ view:"button", type:"form", id:'field_d', label: 'Find flight', align:"center", inputWidth: 150 }						
						]
					},
					{ id:"log", template:function(obj){ return "<pre>"+JSON.stringify(obj).replace(/,/g,"\n,")+"</pre>"; }}
				]}
			]
		});

		
		function set_form(){
			$$('myform').setValues({
				field_a: "Minsk",
				field_b: "Deli",
				field_c: 18,
				field_d: "Button",
				field_e: "3",
				field_f: "25.12.2010",
				field_g: "right",
				field_h: 1,
				field_i: "i2",
				field_j: false,
				field_k: true
			});
		};
		function clear_form(){
			[b]$$('myform').clear();[/b]			};
		function get_form(){
			$$('log').parse($$('myform').getValues());
		};
		
		function parse_xml(){
			//alert(document.getElementById("xml").value)
			$$('myform').parse(document.getElementById("xml").value,"xml");
		};

	</script>
	
</body>

When you clear a form you set the values to empty / blank. The datepicker displays 01-01-1900 when it has an empty / blank value.

I came across this in my application and had to make sure after clearing a form I re-applied today’s date (or whatever date was supposed to be the default) as the value for the datepicker control.

If you want to preselect some day in calendar, you can apply setValue method for the calendar inside “datepicker” popup. Calendar view can be got by the following approach:

$$(“datepickerId_calendar”)

datepickerId - is the id of the dateoicker view.

In the 02_form/01_init.html sample the following can be applied:

$$(‘myform’).clear();
$$(“field_f_calendar”).setValue(new Date());