Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-08-17
3
Medium Priority
?
746 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

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

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…
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

704 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