Skip to content

Instantly share code, notes, and snippets.

@marcinkrzeminski
Created January 22, 2015 12:26
Show Gist options
  • Save marcinkrzeminski/a3200e8d6a684f9c1b33 to your computer and use it in GitHub Desktop.
Save marcinkrzeminski/a3200e8d6a684f9c1b33 to your computer and use it in GitHub Desktop.
jQuery Mask IBAN
<input type="text" name="field-name" class="field-name" />
$(document).ready(function() {
$('.field-name').mask('SS00 0000 0000 0000 0000 00', {
placeholder: '____ ____ ____ ____ ____ __'
});
});
input {
width: 300px;
padding: 5px;
text-transform: uppercase;
}
@kephas
Copy link

kephas commented May 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment