Skip to content

Instantly share code, notes, and snippets.

@joshterrill
Last active August 29, 2015 14:16
Show Gist options
  • Save joshterrill/3acb46a285ae9cc05771 to your computer and use it in GitHub Desktop.
Save joshterrill/3acb46a285ae9cc05771 to your computer and use it in GitHub Desktop.
code that allows the datepicker() to focus first without showing the calendar UI until input field is clicked
function cwUtil_focusDateInput(name) {
var selectedInput = $("[name='" + name + "']");
$(selectedInput).focus();
$(selectedInput).on("click", function() {
$(this).datepicker();
$(this).focus();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment