I have date field (id begin-date)
$( "#begin-date" ).datepicker({
minDate: -20,
maxDate: "+1M +10D",
dateFormat: "yy-mm-dd",
altFormat: "yymmdd"
});
On post, it prints the format as yy-mm-dd (2010-12-08), when it should print as yymmdd (20101208)
Any ideas of why it is not posting it properly with altFormat set?
input field rendered:
<input type="text" name="begin_date" id="begin-date" class="validate[required]" value="" />
The altFormat
option doesn't control the formatting of the input with the date picker, but the format of an alternate (usually hidden) field specified by the altField
option, like this:
$("#begin-date").datepicker({
minDate: -20,
maxDate: "+1M +10D",
dateFormat: "yy-mm-dd",
altFormat: "yymmdd",
altField: "#alt-date"
});
You can test it out here; what you probably want is to just put the name
on that alt field and that's what'll get posted...without a name
the field with the date picker won't get serialized/submitted, for example:
<input type="text" id="begin-date" class="validate[required]" />
<input type="text" id="alt-date" name="begin_date" />