Link to home
Start Free TrialLog in
Avatar of pcmelby
pcmelby

asked on

Use cfselect to jump to a month in cfcalendar? (Coldfusion Flash form)

I am currently using a datefield for date selection in a Coldfusion Flash Form. The problem is occasionally we need to select a date several months or even years in the future. Right now we have to scroll through the calendar until we get to the right month and then select the date. I may have to do away with the datefield altogether and replace it with either a text field or dropdowns for month, day, and year. Before I abandon the datefield, however, I was wondering if there's a way of using a dropdown that lets them easily jump ahead to another month/year?
Avatar of _agx_
_agx_
Flag of United States of America image

>> I may have to do away with the datefield altogether and replace it with either a
>> text field or dropdowns

Are you talking about a cfcalendar? Because a datefield already is a textbox (with a calendar popup on the side).  If do mean a datefield, you can change the displayed month with action script

      <cfformitem type="script">
            function changeCalendarMonth(calMonth, calYear) {
                        // datefield month is 0 based, so deducting 1 to get the correct month
                  myDateField.displayedMonth = calMonth-1;
                  myDateField.displayedYear = calYear;
            }
      </cfformitem>

Or the selected date with the undocumented DateFormatter

      <cfformitem type="script">
            function changeCalendarDate(dateString) {
                  var d:Date = mx.formatters.DateFormatter.parseDateString(dateString);
                  myDateField.selectedDate = d;
                }
      </cfformitem>

I haven't tried it, but those may work with calendar objects too.
         
Avatar of pcmelby
pcmelby

ASKER

I do mean datefield, not cfcalendar. The text field next to the calendar isn't editable, though. You can't type in it, it just displays the selected date from the calendar.

I'll check these out and see if I can get it working right. Thanks!
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial