Skip to content

Instantly share code, notes, and snippets.

@opi
Created November 21, 2012 20:34
Show Gist options
  • Select an option

  • Save opi/4127485 to your computer and use it in GitHub Desktop.

Select an option

Save opi/4127485 to your computer and use it in GitHub Desktop.
Trigger backspace to empty drupal date/hour field
for (var id in Drupal.settings.datePopup) {
$('#'+id).bind('keyup', function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if (code==46 || code==8) {
$(this).val("");
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment