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

Restrict phone number field to the telephone input #192 #195

Closed
wants to merge 3 commits into from

Conversation

JelenaD1
Copy link
Contributor

@JelenaD1 JelenaD1 commented Feb 5, 2022

Resolves #192

Description

This PR is adding validation on phone_number. Number can not be blank and must be 10 digits long.
Before we move on and add specs we need clarification on the phone number format. Format we added does not allow any space or - between the digits. Once we clarify that is a format we want we will go ahead and add specs for student and user model as well.

Type of change

  • New feature which validates phone number.

Screenshots

INKIND

INKIND

INKIND

@JelenaD1
Copy link
Contributor Author

JelenaD1 commented Feb 5, 2022

@garettarrowood We added a simple validation for presence and for a length. Before we update the specs we wanted clarification on the phone number format. Right now we don't allow any space between the digits or any -. Is that fine or do we want different format?

@garettarrowood
Copy link
Member

Our main branch has gotten a little out of whack.

If you'd like to continue to work on this, please cherry-pick these two commits and open up a fresh PR. Sorry for the inconvenience!

In regards to your question, I believe one solution may be to strip all -, (, ), and . out of the input, then validate the length of 10 numeric characters.

cc/ @RudeChowder

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

Successfully merging this pull request may close these issues.

Restrict phone number field to the telephone input
2 participants