I'm using the wonderful A&M form plugin to create a form on my site, and I have 3 dropdowns for the user's birthday: month, day, and year. Currently, I have it set up so that when the form submits, those values get put into a matrix field when logged in the form submissions entry in the CMS. I would prefer to have it put into a date/time field though, but I'm unsure how to do it.
This is the code in my form:
<label>Birthday</label>
<input type="hidden" name="fields[birthday][new1][type]" value="date">
<div id="birthday">
<select name="fields[birthday][new1][fields][month]">
<option selected="selected" value="">M</option>
{% for i in 1..12 %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
<select name="fields[birthday][new1][fields][day]">
<option selected="selected" value="">D</option>
{% for i in 1..31 %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
<select name="fields[birthday][new1][fields][year]">
<option selected="selected" value="">Year</option>
{% set startYear = now.year - 15 %}
{% set endYear = now.year - 110 %}
{% for i in startYear..endYear %}
<option value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
</div>
In this case, "birthday" is my matrix field handle and "date" is the block type handle. "month", "day", & "year" are obviously the field handles within the matrix field.
There's nothing in the docs. I understand a date/time field doesn't produce an object like a matrix field, but I can't think of a solution of how to convert it.