Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

11 Experts available now in Live!

Get 1:1 Help Now