Solved

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

Posted on 2010-08-17
3
737 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Refreshing ColdFusion Page with Selected Value 8 69
Sending Text Messages 1 52
query of query sort 6 97
Why data not loading into APPLICATIONS scope (memory) ? 7 47
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now