Skip to main content
BreakawayPaul
Inspiring
June 2, 2011
Answered

cfcalendar won't return selected value

  • June 2, 2011
  • 2 replies
  • 4186 views

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).

    This topic has been closed for replies.
    Correct answer Adam Cameron.

    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

    2 replies

    Inspiring
    June 2, 2011

    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

    BreakawayPaul
    Inspiring
    June 2, 2011

    Adam Cameron. wrote:

    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

    Good idea.  Here's what I've been using:

    <cfform id="reschedule" format="html" method="post" action="reschedule.cfm">

    <cfcalendar
        name="schedule"
        required="yes"
        daynames="Su, M, T, W, Th, F, Sa"
        monthnames="January, February, March, April, May, June, July, August, September, October, November, December"
        width="250"
        height="200"
        />--->
    <cfinput type="submit" name="submit" class="submit" value="Submit" />

    </cfform>

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

    Adam Cameron.Correct answer
    Inspiring
    June 2, 2011

    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

    Inspiring
    June 2, 2011

    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.

    BreakawayPaul
    Inspiring
    June 2, 2011

    Yes, I'm using post.  I really don't want to use get because I'm passing tons of info that's full of spaces and things.

    When I dump #FORM.calendarname# I get: [empty string]

    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.

    Inspiring
    June 2, 2011

    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:

    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.