Tuesday, October 11, 2005

SVG calendar control

I have just uploaded the above into http://www.hiew.per.sg. File name is calendar.svg There are a number of input controls written in activex, java, javascript etc. This control is written in SVG. It does exactly as what the name provides. The control will replace a Input field with the name "svgdate" with the selected date. You can always modify it to work with different date format or even the field name of the parent document.

Alternatively you can insert definition "top.myfunction = mysvgfunction" into the svg script and create a function called mysvgfunction in svg to provide the date value then call myfunction from the parent script to get the date value. Obviously you must store the date variable as a svg global value.

Below is a simple web page to store the date string from the svg when user selects a date.

<form action="">
<input name="svgdate" type="text" value="" size="30">
<EMBED name="emap" pluginspage="http://www.adobe.com/svg/viewer/install/" src="calendar.svg" width="140" height="140" type=image/svg+xml>