make BIC optional, fix IBAN validator

This commit is contained in:
Ricardo (XenGi) Band 2025-04-04 22:34:54 +02:00
commit 1c2bab4491
No known key found for this signature in database
3 changed files with 12 additions and 6 deletions

View file

@ -76,7 +76,9 @@ validateBic = (target) => {
validateIban = (target) => {
if (target.value.length == 0) return
// IBANs are fucking complicated. this is a hugely simplified check
const re = /^[a-z]{2}[0-9]{20}$/i;
// If you want to know more look here:
// https://www.swift.com/standards/data-standards/iban-international-bank-account-number
const re = /^[a-z]{2}[0-9a-z]+$/i;
if (re.test(target.value)) {
target.classList.remove("is-danger")