Skip navigation
Currently Being Moderated

cfcalendar won't return selected value

Jun 1, 2011 5:28 PM

My host runs CF8, and I'm building a website for my wife's business.  I'm trying to use cfcalendar to allow customers to pick appointment dates, but I'm having a problem.

 

I assumed you get the selected date by submitting the form and looking at #FORM.calendarname# (where calendarname is whatever the name= attrib of the cfcalendar tag).

 

I'm using it in a cfform with format="html" which is supposedly allowed, but the form returns nothing.  If I switch it format="flash" then it works fine.

 

Is there any way to get it to work with an HTML form?  I really don't want the entire form to be flash (not to mention that I've heard flash forms are going away in future versions of CF).

 
Replies
  • Currently Being Moderated
    Jun 1, 2011 6:58 PM   in reply to BreakawayPaul

    Yes that is how it should work IF you are using method POST. Are you? You can also cfdump both scopes (FORM and URL) at the top of your page to see what values are being passed.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2011 7:34 PM   in reply to BreakawayPaul

    I was not suggesting you should use GET. just that you verify you are using the correct variable scope.

     

    When I dump #FORM.calendarname# I get: Re: cfcalendar won't return selected value

     

    Sounds like you did not select a date from the calendar. When you do not select a date, the field value is an empty string.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2011 7:37 PM   in reply to BreakawayPaul

    It's looking like I'm about to go snippet hunting for a

    javascript calendar, which is sort of what I was trying to

    avoid by using CF.

     

    You should not need to look too far. IIRC CF8 supports cfinput type="datefield" which is html based (not flash like cfcalendar).

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2011 11:07 PM   in reply to BreakawayPaul

    It would help if you posted some code that demonstrates what you're seeing, so we can try it too.  And/or check that there's nothing else idiosyncratic about it that make it behave in a way you're not expecting.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2011 11:10 PM   in reply to BreakawayPaul

    It's looking like I'm about to go snippet hunting for a javascript calendar, which is sort of what I was trying to avoid by using CF.

     

    It doesn't need to be a very long hunt.  JQuery has a plug-in which will do everything you need (and a bunch of stuff you won't need), and it's all pretty straight forward.

     

    I'd use the JQuery offering over the CF offering anyhow: I'd always use a JS/HTML solution over a Flash solution where possible (and all other considerations being equal).

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2011 6:06 AM   in reply to BreakawayPaul

    I think you've found a bug.  Remove the ID attribute of the CFFORM tag, then it works.

     

    You should raise the bug here:

    http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

     

    Report back with the bug ref, so people know where it is, and can vote for it.

     

    Also: as a general rule, it's a bad idea to have a submit button with a name "submit".  It can collide with JS which leverages the submit() method of the form object.  It's nothing to do with your issue here, but just something to remember.

     

    As far as the JQuery thing, I guess I'm not using that because I don't know the first thing about JQuery, LOL!

     

    Same as everyone else before they started with it then.

     

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2011 9:50 AM   in reply to Adam Cameron.

    I think you've found a bug.  Remove the ID attribute of

    the CFFORM tag, then it works.

     

    Interesting. It also works if you give the cfform a "name" (CF9).

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2011 12:01 PM   in reply to BreakawayPaul

    Hm... sounds like something internal requires a form "name" maybe? Post the bug # here when you, or Adam, have it.

     

    -Leigh

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 3, 2011 12:39 AM   in reply to -==cfSearching==-

    I can't even see the issue in the bug tracker.  What's the bug ID, BreakawayPaul?

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 3, 2011 1:26 PM   in reply to BreakawayPaul

    btw Adam, I have the JQuery UI datepicker working perfectly, so thanks to everyone who suggested that route.  I've even gotten it to mark weekends, holidays, and vacations off, and figured out how to integrate some CF code to set the earliest available booking date.

     

    Yeah, JQuery has some good stuff, and is generally pretty well-written and easy to use.

     

    JQuery does a pretty good job at cross-browser compat, but always make sure to test all this stuff on all browsers you mean to support.  Sometimes there are idiosyncracies with older browsers (usually old IE versions, in my - limited - experience).

     

    --

    Adam

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points