views:

48

answers:

0

Hi all,

I have a button called 'view', when I click it will fire an ajax call and show details of a product in a div in the page. In this div, I show product details like description, uploaded date.

The problem is that, all data are coming nicely in this div including date, but when we click the calendar to edit (this div content is editable) the date, it gives error "cal3 is null or undefined".

See the code sample below for calendar code in div. This div content is in a separate page which is fired by ajax on onclick event of a button called view

<input type="Text" name="com_start_date" id="com_start_date" size="8" maxlength="10" readonly value="#com_start_date#" >                                     
    <a href="javascript:cal3.popup();"> 
    <img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>

and the page which shows the div has the calendar object creation below...

var Objupload_date=document.forms['partnerupdate'].elements['com_start_date'];

if(Objupload_date!=null) {    
    var cal3 = new calendar2(Objupload_date);
    cal3.year_scroll = true;
    cal3.time_comp = false;    
}

And also the calendar js file is included in the main page where the view button is there.

Thanks in advance