Closed badikgit closed 1 month ago
Can you explain your use case - why you want to support users replacing digits with letters? I see you have validationNumberType set to MOBILE, so in your case, you're only accepting mobile numbers - I can't imagine why someone would replace digits with letters in their mobile number, can you? In my opinion, if you're asking for a mobile number and the user includes a letter character, it would be much more likely to be a mistake than intentional.
You mention that in previous versions, the plugin used to return valid for (valid) numbers containing letters, and you're right, but so many people complained, saying validation is passing when it shouldn't, that I changed it so that validation fails if there are any letters, and I haven't had any complaints since.
(this change was made in v20.0.0 by the way, back in March of this year)
You are right, this is a rare use case when it may be more convenient for the user to enter the number using letters. It is only relevant for people (like VIP) who specifically buy a number that is convenient to enter as a word. I was just confused when I saw the validation problem with this use case in the new version, unlike the last version I used, and I considered this a unique and attractive feature.
Ok I'll close this issue for now.
You may want to review the breaking changes in the release notes of each major version since the one you were using before, to avoid surprises like this.
Thank you for the helpful advice.
Plugin version
e.g. v24.5.0 (please try latest version)
Steps to reproduce
iti
instance as in the documentation examples with the settings provided in Initialisation options (below).Expected behaviour
Calling
isValidNumber
is expected to returntrue
, as it was in previous versions (e.g. v18.2.1).Actual behaviour
The result of calling
getValidationError
is 0, which corresponds to the possible number. The result of callinggetNumber
is also correct, and the phone number containing letters is converted to a valid phone number with digits instead of letters. But despite all this, the result of callingisValidNumber
isfalse
.Initialisation options