Skip to content

Instantly share code, notes, and snippets.

@VladimirPal
Last active August 29, 2015 14:18
Show Gist options
  • Save VladimirPal/e93101b0d9029e83677f to your computer and use it in GitHub Desktop.
Save VladimirPal/e93101b0d9029e83677f to your computer and use it in GitHub Desktop.
Blur validation
events:
"blur form input": "validateInput"
validateInput: (ev) ->
$input = $(ev.target)
input_name = $(ev.target).attr 'name'
input_value = $(ev.target).val()
if input_value.length
@model.set input_name, input_value
@model.isValid input_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment