arhs / iban.js

IBAN & BBAN validation, formatting and conversion in Javascript
https://arhs.github.io/iban.js/
MIT License
534 stars 128 forks source link

Upper Lower case first two letter #70

Closed Tchoukoualeu closed 4 years ago

Tchoukoualeu commented 5 years ago

Validate the field whether it is lower or upper case

I am using this project to help validate Iban on a project I'm currently working on. I noticed many users were having a problem with Upper and Lower case while filling up their IBAN.

Just added a quick fix that will uppercase the input in case the user enters its Iban in lower case.

I also made sure to add style="text-transform: uppercase;" to the id="userInput"

EyMaddis commented 4 years ago

You just edited the demo, not the library. The fix should be implemented for all users. However it should probably reject lower case IBANs...?

Tchoukoualeu commented 4 years ago

You are right. The way I implemented is was

  1. to force the input field to upperCase what the user type on the HTML side
  2. to make the input value upperCase on the JS side to

I think it was more efficient since inputting the IBAN with lowercase is most probably a mistake on the part of the customer.