Last active
January 6, 2016 14:53
-
-
Save 5minpause/f4d08bdeeec9b4724bad to your computer and use it in GitHub Desktop.
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
validVinExp: function () { | |
// WDD 169 007-1J-236589 | |
// WDB1681331J93895 | |
return new RegExp('^(wdb|wdd)\\s*[\\d\\s]{6,}-?[\\w\\d]{2}-?[\\d]{5,6}$', 'i'); | |
}, | |
evaluateVin: function (value) { | |
return this.validVinExp().test(value); | |
}, | |
vinOnChange: function () { | |
var vinInput = document.getElementsByName('car[vin]'); | |
if (vinInput.length > 0) { | |
vinInput.on('change', function(e) { | |
App.carSelect.evaluateVin(vinInput.value); | |
}); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment