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

Validate Country Code before submitting #2

Closed
wants to merge 2 commits into from

Conversation

thatfreakcoder
Copy link

Regarding Issue #1
I've added a simple if statement that validates whether the number has +91 Country Code in the beginning or not through a simple RegEx match() method. If present, continues normally, else adds +91 and continues normally.

@ayush5588
Copy link

ayush5588 commented Jun 6, 2021

Nice observation. But we also have to consider the fact that the message can be sent to a number outside of India. In that case I think adding +91 would not work.
So to deal with that I think maybe if possible then there can be a field where the user can enter the country (where the message has to be sent) and then accordingly the Country Code can be added to the number.

@thatfreakcoder
Copy link
Author

@ayush5588 yes, I too had this in my mind. but for such a simple app like this one, I don't think we should focus on validating it for every country but rather check our targeted audience and make it more seamless for them, and not put them through the process of selecting a country (and hence a country code)

@ayush5588
Copy link

@thatfreakcoder Yeah that seems right.

@iamyajat
Copy link
Owner

iamyajat commented Jun 7, 2021

Hey @thatfreakcoder, I agree with @ayush5588 here. If a non Indian person is trying to contact someone, they might end up messaging the wrong person, if they forget to put the country code.
It would be great if you could do a country check and add their respective country code instead of just +91.
Peace

@thatfreakcoder
Copy link
Author

yeah @iamyajat, i was working on a side project that implemented this, so will include that in a future update, for the time being, can you merge the current branch for +91 indian code?

@iamyajat iamyajat closed this Jun 13, 2021
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.

3 participants