DHTMLX Docs & Samples Explorer

dhtmlxCalendar

From JSON From XML
Source
<!DOCTYPE html>

<html>
<head>
	<title>dhtmlxCalendar</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		td.p2 {
			padding-left: 50px;
		}
	</style>
	<script>
		var myForm, myForm2, formData;
		function doOnLoad() {
			formData = [
				{type: "settings", position: "label-left", labelWidth: 120, inputWidth: 120},
				{type: "input", label: "Name", value: "John Smith"},
				{type: "password", label: "Password", value: "123"},
				{type: "select", label: "Session", options:[
					{value: "1", text: "Administration"},
					{value: "2", text: "Design"},
					{value: "3", text: "Manage Articles"}
				]},
				{type: "calendar", dateFormat: "%Y-%m-%d %H:%i", name: "start_date", label: "Start Date", value:"2011-06-20 14:38", enableTime: true, calendarPosition: "right"},
				{type: "calendar", name: "end_date", label: "End Date", dateFormat: "%Y-%m-%d", serverDateFormat: "%d.%m.%Y", value: "20.06.2011", calendarPosition: "right"}
			];
			myForm = new dhtmlXForm("myForm", formData);
			myForm2 = new dhtmlXForm("myForm2");
			myForm2.loadStruct("../common/dhxform_calendar.xml");
		}
		function doOnUnload() {
			myForm.unload();
			myForm2.unload();
			myForm = null;
			myForm2 = null;
		}
	</script>
</head>
<body onload="doOnLoad();" onunload="doOnUnload();">
	<table>
		<tr>
			<td>From JSON</td>
			<td class="p2">From XML</td>
		</tr>
		<tr>
			<td valign="top"><div id="myForm" style="height:330px;"></div></td>
			<td valign="top" class="p2"><div id="myForm2" style="height:330px;"></div></td>
		</tr>
	</table>
</body>
</html>