Skip to main content
Participant
July 4, 2008
Question

CFCALENDAR form input is passing empty... Can't figure out why.

  • July 4, 2008
  • 1 reply
  • 547 views
I'm using cfcalendar to let users select a date, then they submit the HTML form. My code is simple...

<cfform action="calendarTest.cfm" method="post" format="html">
<cfcalendar name="startDate" height="220" width="220">
<input type="submit" value="submit" />
</cfform>

I post the form but the form variable sent is an empty value.

form.startDate exists, but its empty and I don't know why because I'm selecting the date when I submit the form! Is there something I'm missing? It's such basic code and I'm completely frustrated as to why it's not working.

Please advise!

Thanks!
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 4, 2008
    your code is fine. it works with me. are you sure you selected a date(click once and make sure it is highlighted except for the current date being highlighted already)?
    Participant
    July 4, 2008
    Yeah I'm definitely selecting a date and submitting the form. I click on a day and it turns green, thus it is selected, right? The form and the receiving code is all in the same CFM file. Here's all the code:

    <cfparam name="form.submitDate" default="0" type="boolean">
    <cfif form.submitDate>
    <cfoutput>
    Date: #form.startDate#<br />
    Value Length: #len(form.startDate)#<br />
    </cfoutput>
    <cfelse>
    <cfform action="calendarTest.cfm" method="post" format="html">
    <p>Select the date you'd like your ad to begin appearing:</p
    <p><cfcalendar name="startDate" height="240" width="240"></p>
    <input type="hidden" name="submitDate" value="1"/>
    <input type="submit" value="submit" />
    </cfform>
    </cfif>

    I did notice, though, that it sends the empty value whether I select a date or not.

    Is there a problem with the way I'm calling the variable? form.startDate ....?

    Could there be a problem with the server configuration? Maybe they need to update CF?

    I'm at a loss because this is incredibly simple code and it's malfunctioning for no apparent reason.

    Thanks a lot for your help! :)
    Inspiring
    July 7, 2008
    have you tried changing your cfform format to Flash instead of HTML and check if it works? Also, if you change it to FLASH, try to make sure your submit button is in <cfinput> tag.