Skip to content

Instantly share code, notes, and snippets.

@MichaelCPell
Created November 19, 2014 21:31
Show Gist options
  • Select an option

  • Save MichaelCPell/2322be6fd6858b197cc6 to your computer and use it in GitHub Desktop.

Select an option

Save MichaelCPell/2322be6fd6858b197cc6 to your computer and use it in GitHub Desktop.
example client-side basic validation
$("#day-field").change(function(){
new_val = $(this).val()
if(new_val < 1 || new_val > 31){
$(this).val(1)
$("#day-field").append("<p>Invalid Date Entered</p>")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment