Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Aspi on Jul 18, 2008 00:27
open dhtmlx forum
dhtmlXCalendar

what's wrong in IE 6
here is the code:

var mCal1;
window.onload = function () {
        
        
        mCal1 = new dhtmlxCalendarObject('mCal1');
        mCal1.setYearsRange(2000, 2500);
        mCal1.setOnClickHandler(szuldatum1);
        mCal1.draw();
        
        mCal2 = new dhtmlxCalendarObject('mCal2', false, {isYearEditable: true,isMonthEditable: true});
        mCal2.setYearsRange(2000, 2500);
        mCal2.setOnClickHandler(szuldatum2);
        mCal2.draw();

        
    

    function szuldatum1(date) {
        
     document.getElementById('szuldatum1').value = mCal1.getFormatedDate(null,date );

        document.getElementById('mCal1').style.display = 'none';
    }
    
    function szuldatum2(date) {
        
document.getElementById('szuldatum2').value = mCal2.getFormatedDate(null,date );
        document.getElementById('mCal2').style.display = 'none';
    }}


function showCalendar(calnev) {
        document.getElementById(calnev).style.display = 'block';
    }
    </script>
<select name="sz" id="sz">
<option value="3">3
</select>
<table border="0" cellpadding="5" >

<tr>
<td ><input type="text" name="partnernev" id="partnernev" value=""/></td><td><input type="text" name="szulhely" id="szulhely" value=""/></td>
<td><div id="mCal1" style="display:none; position:absolute;"></div><input type="text" name="szuldatum1" id="szuldatum1" readonly="true"><img onClick="showCalendar('mCal1')" src="js/calendar/imgs/calendar.gif"></td>
    <td><div id="mCal2" style="display:none; position:absolute;"></div><input type="text" name="szuldatum2" id="szuldatum2" readonly="true"><img onClick="showCalendar('mCal2')" src="js/calendar/imgs/calendar.gif"></td></tr></table>

object doesn't support property or method

thank your answer
Answer posted by Support on Jul 18, 2008 01:44
In case of IE it is unsafe to use the global variable with same name as ID of HTML node ( var mCal1; and  <div id="mCal1" ) just change one of those names.