Error when submitting Date Field from the front-end: cannot be blank Am using the Pikaday datepicker to add a Date field to the front-end of a Craft site: https://github.com/dbushell/Pikaday

This is for integration with the Formerly add-on and the date is set to required.

When I try to submit the form I get the following error:

2016/02/03 12:23:54 [warning] [application] Craft\ContentModel-&gt;dateTest_testDate failed validation: Test Date cannot be blank.

Are date inputs submitted via the front-end required in a particular format?


also experiencing same problem with Sprout Forms
The input tag presented in the comments above does not appear to use the correct input tag format for the date field. To submit a date field on the front-end, your input fields need to be setup with the following name structure and value format:

&lt;input type="text" size="10" name="fields[fieldHandle][date]" value="10/15/2012"&gt;
&lt;input type="text" size="10" name="fields[fieldHandle][time]" value="6:12 PM"&gt;


Using your example field handle of child1DateOfBirth this would be:

&lt;input type="text" size="10" name="fields[child1DateOfBirth][date]" value="10/15/2012"&gt;
&lt;input type="text" size="10" name="fields[child1DateOfBirth][time]" value="6:12 PM"&gt;


To submit any field on the front-end of Craft requires that you use the right format for the input field you are submitting.  Assuming the field submits just fine from within Craft, one way to track down the format you need on the front-end is to use your browser's developer tools and look at the input tags for the respective field in the Craft control panel.

The Craft CMS Field Guide on Straight Up Craft is another resource that gives examples of all the different native Craft fields and examples of input fields for the front-end.

If things currently aren't working, consider trying to hard code these values and confirm that this works at all.  You'll then need to figure out how to get the respective datepicker you are using to format the selected data into the proper input format as described above.



I don't believe this is an issue with any specific form plugin being used.  In the case you wanted to use a dynamic date field with your form (instead of manually creating your form as you describe above), you could extend Sprout Forms and add support for a custom front-end field.