2 Replies Latest reply on Jan 22, 2013 6:57 AM by elvideo123

    Can't get cfcalendar control work client side to selectedDate with JavaScript

    elvideo123

      I am not sure why this is happening, I have a function where I am passing a date value, and I've seen it while displaying it and in alerts.  So it comes across such as this 01/22/2013.

       

      I am trying to get the cfCalendar control I have to select the date but I can't seem to reference the property...

       

      Simple control defined in the form:

       

      <cfcalendar name="calDisplay" 

              selectedDate="#SelDate#"     

              mask="mmm dd, yyyy"

              dayNames="Su,M,Tu,W,Th,Fr,Sa"

              monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"

              style="rollOverColor:##FF0000"        

              width="150" height="150" id="calDisplay"  >

       

       

      here's the javascript the parameter is being passed correctly this I have verified:

       

      function edit_Item(st_Date)

      {

       

        document.getElementById('calDisplay').value = stDate;  //doesn't work

       

           document.getElementById('calDisplay').value = Date(stDate); //doesn't work

       

      document.getElementById('calDisplay').selectedDate= stDate; //doesn't work

       

      document.getElementById('calDisplay').select(stDate);  //doesn't work

       

      }

       

      This has to be a real simple thing to do I am sure it's 2 lines of code, but the calendar will not highlight the date I am passing and select it.  I am not sure what to do.

       

      If anyone has any suggestions, please let me know.  I am trying to do this client side with the control I hope this is possible.

       

      Thanks,

       

      - E