Skip to content

Instantly share code, notes, and snippets.

@robtarr
Created May 7, 2012 15:08
Show Gist options
  • Save robtarr/2628275 to your computer and use it in GitHub Desktop.
Save robtarr/2628275 to your computer and use it in GitHub Desktop.
Form Validation with H5F and jQueryUI Datepicker
.valid {
background: green;
color: #fff;
}
.error {
background: red;
color: #fff;
}
<form id="h5ftest">
<input type="date" required pattern="\d{2}\/\d{2}\/\d{4}">
</form>​
$(function() {
H5F.setup( $( "#h5ftest" ) );
$( "[type=date]" ).datepicker({
onClose: function() {
$( this ).focus().blur();
}
});
​});
name: H5F Validation with jQueryUI Datepicker
description: Making date fields validate on datepicker close
authors:
- Rob Tarr
resources:
- https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js
- https://raw.github.com/ryanseddon/H5F/master/h5f.js
normalize_css: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment