A Pen by Marcin Krzeminski on CodePen.
Created
January 22, 2015 12:26
-
-
Save marcinkrzeminski/a3200e8d6a684f9c1b33 to your computer and use it in GitHub Desktop.
jQuery Mask IBAN
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
<input type="text" name="field-name" class="field-name" /> |
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
$(document).ready(function() { | |
$('.field-name').mask('SS00 0000 0000 0000 0000 00', { | |
placeholder: '____ ____ ____ ____ ____ __' | |
}); | |
}); |
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
input { | |
width: 300px; | |
padding: 5px; | |
text-transform: uppercase; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IBANs can contain letters everywhere but in the two check digits after the country code. Most French IBANs, for example, contain at least one letter and would be rejected by that mask. Also, the standard for IBAN allows up to 30 chars.