Last active
August 29, 2015 14:18
-
-
Save VladimirPal/e93101b0d9029e83677f to your computer and use it in GitHub Desktop.
Blur validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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