Restrict tel nr length to 15

This commit is contained in:
2023-05-15 18:04:05 +02:00
parent 92ff8a5dc9
commit 2210b6b829

View File

@ -76,7 +76,7 @@ namespace Elwig.Helpers {
public static ValidationResult CheckPhoneNumber(TextBox input, bool required) {
string text = "";
int pos = input.CaretIndex;
for (int i = 0, v = 0; i < input.Text.Length && v < 30; i++) {
for (int i = 0, v = 0; i < input.Text.Length && v < 15; i++) {
char ch = input.Text[i];
if (v == 0 && input.Text.Length - i >= 2 && ch == '0' && input.Text[i + 1] == '0') {
v++; i++;