Skip to content

Instantly share code, notes, and snippets.

@shaneriley
Created July 23, 2011 11:27
Show Gist options
  • Save shaneriley/1101324 to your computer and use it in GitHub Desktop.
Save shaneriley/1101324 to your computer and use it in GitHub Desktop.
datetime-local serialization
var $form = $("form"),
values = $form.serializeArray();
// jQuery doesn't currently support datetime-local inputs despite a
// comment by dmethvin stating the contrary:
// http://bugs.jquery.com/ticket/5667
// Manually storing input type until jQuery is patched
$form.find("input[type='datetime-local']").each(function() {
var $i = $(this);
values.push({ name: $i.attr("name"), value: $i.val() });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment