question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enter Valid Phone Number Form Error

See original GitHub issue

I keep getting this form error even though I have formatted my number in the following ways:

+1 01 212 555-2345 +1 01 212 5552345 +15552345 15552345 5552345 212 555 2345 2125552345

This is my model:

class Contact(models.Model): phone = PhoneNumberField(blank=True)

This is my Form:

class ExpForm(forms.Form): phone = PhoneNumberField()

And this is my template for phone:

                           <div  id="phone" class="form_field">
            {{ form.phone.errors }}
            <label>{{ form.phone.label_tag }}</label>
            {{ form.phone }}
            </div>

How are the numbers supposed to be formatted for the Form fields? I couldn’t find any examples.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
tochimclarencommented, Oct 26, 2018

I am still getting the invalid phone validation error

1reaction
amatejacommented, Mar 30, 2016

Thank you for reporting. Our project has evolved since that time and this issue will be closed. Please update and reopen if you feel it is still applicable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR: "Please enter a valid Phone" - Zoho Cares
Hi, The default for the US is (xxx) xxx-xxxx. If you enter the phone number with no spaces or characters (e.g. xxxxxxxxxx) it...
Read more >
How do I fix "Enter a valid phone number" error when ...
Try entering the phone number without any spaces (including the + symbol, country code, and area code). Example. Phone Number: +44 1632 960098....
Read more >
Why am I seeing an error with a valid phone number when ...
When attempting to register for an account using a valid phone number, I'm getting errors: Please do not enter country code in your...
Read more >
"Please enter a valid phone number" message is unhelpful
1) fix the regex · 2) add help_test explaining the expected format · 3) add more information about expected format to server side...
Read more >
Bad Practices on Phone Number Form Fields | by UX Movement
Your users should not wonder which phone number format is valid or get a validation error for the wrong phone number format. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found