• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

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

Views

500

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 18, 2013 Jan 18, 2013

Copy link to clipboard

Copied

cfcalendar produces a flash object which is not accessible by javascript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2013 Jan 22, 2013

Copy link to clipboard

Copied

LATEST

well this is no good... anyone suggest a similar calendar control I could use.. that does what I need to do?

I am trying a simple coldfusion cfinput datefield instead, and this is sort of working since I can set the field to the date using javascript.

The only problem is that if the calendar is still open, It wont highlight the correct date.  If I close it and reopen it then yeah sure it will show it.

Is this also not possible with a cfinupt datefield?  If I can get it to highlight the correct date, or simply just close the calendar (the little X action) but I am not getting this going either (It's either not possible or I am calling the wrong properties or method.).

Any other info would be useful.  Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation