Last active
June 2, 2020 05:34
-
-
Save masterfermin02/0aacdcbd636516e820eadebc1c590796 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function formatCedulaNumber(str) { | |
if (str.length < 3 && str.length < 11) { | |
return str; | |
} | |
if (str.length === 3) { | |
return str + '-'; | |
} | |
if (str.length === 11) { | |
return str + '-'; | |
} | |
return str; | |
} | |
function formatCedula(input) { | |
input.val(formatCedulaNumber(input.val())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment