Solved

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

Posted on 2010-08-17
3
739 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:pcmelby
  • 2
3 Comments
 
LVL 52

Expert Comment

by:_agx_
ID: 33456234
>> 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.
         
0
 

Author Comment

by:pcmelby
ID: 33456749
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!
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 33457191
Then you probably want to set the selectedDate then. It also changes the value displayed in the text box and is what drives the displayed month/year when the calendar opens.  

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question