Hi,
I want to add a date picker for a field in DCT. I am using an inbuilt javascript file calendar_init.js
But this is not working out properly and is giving an error. Can Someone help me whether I am doing it in a proper way.Below are the codes which I've used inside my DCT:
/* -------- This is the script added in DCT -------- */
<script>
IWEventRegistry.addFormHandler("onFormInit", init);
function init(){
IWEventRegistry.addItemHandler("/offerContainer/offerValidity", "onCallout", calendar);
alert("done with the init");
}
//--start-calendar
var fwContextPath = "/iw-cc";
var calendar_skin = new Object();
calendar_skin.full_months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
function calendar(item)
{
alert("calling calender");
function DateCallBack(date)
{
item.setValue(formatDate(date, "dd-MM-yyyy"));
}
var theCalendarWindow = fwShowCalendar("-callback", DateCallBack, "-initialdate", new Date().x());
alert("done calling calender");
}
//--end-calendar
</script>
<script language="javascript" location="webserver" src="/iw-cc/base/widget/calendar/calendar_init.js"/>
/* ---- This is the field for which Datepicker is added ---- */
<!--start-calendar-->
<item name="offerValidity" pathid="offerValidity">
<label>Offer Validity</label>
<description>Please enter Publish Date in dd-MM-yyyy format</description>
<text required='t' size="60" maxlength="10"
validation-regex="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d">
<callout url=" " label="Calendar" />
</text>
</item>
<!--end-calendar-->
/* -- Below is the error which I am getting when I click on the calender button --*/

Anything I am missing here? Thanks in advance.
TS - 7.4.1
Windows server 2012