Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phone validation fix #1313

Merged
merged 2 commits into from
Feb 26, 2024
Merged

phone validation fix #1313

merged 2 commits into from
Feb 26, 2024

Conversation

pvighi
Copy link
Contributor

@pvighi pvighi commented Feb 20, 2024

What does this change

Switches the form field for phone numbers from type=number (totally wrong, allows people to submit decimal phone numbers and accidentally increment them if their cursor happens to be inside the field and they scroll their mousehweel!) to type=tel.

tel fields are not inherently useful in terms of validation:

Unlike <input type="email"> and <input type="url">, the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.

...but it's good practice to match inputs to the data type, and they have one big advantage:

One of the main advantages of <input type="tel"> is that it causes mobile browsers to display a special keyboard for entering phone numbers.

More here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel

Tests

  • Tested in CODE

@pvighi pvighi marked this pull request as ready for review February 22, 2024 15:28
@raphaelkabo raphaelkabo merged commit 34f471d into main Feb 26, 2024
11 checks passed
@raphaelkabo raphaelkabo deleted the pv/phone_validation branch February 26, 2024 13:14
@prout-bot
Copy link
Collaborator

Seen on PROD (created by @pvighi and merged by @raphaelkabo 11 minutes and 33 seconds ago) Please check your changes!

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

Successfully merging this pull request may close these issues.

3 participants