Closed jcassarly closed 3 years ago
In my experience, you're better off not validating the format of a phone number at all. There are a lot of corner cases, especially if you include international numbers.
On Sun, Oct 4, 2020, at 20:16, Jared Cassarly wrote:
If a user enters a phone number in the wrong format, it takes you back to the editting page, but does not display an error message
For example
(555)-555-5555 wiill not work and not reasonable error message is displayed.
- The regex should maybe allow this pattern
- a proper error message should be displayed if the regex does not match
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/beta-nu-theta-chi/ox-dashboard/issues/64, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEU7QTY7XJD4VGFS6DAM43SJEF7BANCNFSM4SEBCXFA.
Seems fair, the regex was already there, so I didn't really see a reason to remove it. Thats probably a much easier solution too.
This should have been resolved when I restored error messages for forms in the templates. The regex allows for up to 15 digits so international numbers should be okay. This leaves only the issue that you cannot include dashes in the phone number. I guess we can determine if that's a big enough deal that we should rewrite the validator? Honestly, as long as the error message is explicit enough that you have to only include integers I think it's fine.
I agree, go ahead and close this issue then
On Fri, Nov 20, 2020, 3:54 AM helper08 notifications@github.com wrote:
This should have been resolved when I restored error messages for forms in the templates. The regex allows for up to 15 digits so international numbers should be okay. This leaves only the issue that you cannot include dashes in the phone number. I guess we can determine if that's a big enough deal that we should rewrite the validator? Honestly, as long as the error message is explicit enough that you have to only include integers I think it's fine.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/beta-nu-theta-chi/ox-dashboard/issues/64#issuecomment-731034597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI4HGM3JPTZESWMSHJEZKDSQYVDFANCNFSM4SEBCXFA .
If a user enters a phone number in the wrong format, it takes you back to the editting page, but does not display an error message
For example
(555)-555-5555 wiill not work and not reasonable error message is displayed.