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

Mobile no is integer field make it regex field or simply character #102

Closed
prajintst opened this issue Aug 16, 2018 · 7 comments
Closed

Comments

@prajintst
Copy link

https://github.com/IEEEKeralaSection/rescuekerala/blob/app/restendpoint/models.py
mobile no is integer field.

Ensure this value is less than or equal to 2147483647.

@bobinson
Copy link

While testing keep in mind that people will be panicking and entering wrong numbers. Validations should not prevent people from entering numbers.

@sreenadh
Copy link

@bobinson how about #84

@sidharthv96
Copy link

@bobinson , This is exactly why we need validators. If they panic and enter 9 numbers or 11 numbers, that data is worthless for us. So we should add a strict validator that accepts just 10 numbers. Maybe starting with 6,7,8,9

@prajintst
Copy link
Author

prajintst commented Aug 16, 2018

regex is best at all take a look at
https://stackoverflow.com/questions/19130942/whats-the-best-way-to-store-phone-number-in-django-models

regex for india ^[6-9]\d{9}$

@vvishakhp
Copy link

All browsers now support an input type 'tel' which is used to enter telephone numbers.

@vvishakhp
Copy link

<input type="tel" placeholder="9876543210" pattern="\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$" >

You can use this.

This validates all major phone number formats even if it includes 'spaces' or '-'

@naveenpf
Copy link

Duplicate #84

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

No branches or pull requests

6 participants