LearnNewsExamplesServices
Frontmatter
id4368
titleform.field.Phone : Phone number validation is required
stateClosed
labels
enhancement
assignees[]
createdAtMay 3, 2023, 6:27 AM
updatedAtMay 3, 2023, 2:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/4368
authorPriyankaTakalkar
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 3, 2023, 2:46 PM

form.field.Phone : Phone number validation is required

Closed v8.1.0 enhancement
PriyankaTakalkar
PriyankaTakalkar commented on May 3, 2023, 6:27 AM

Current result: no error message when filling in fields that logically should only be filled with numbers.

Expected result: Error message should appear when exiting the fields.

PriyankaTakalkar added the enhancement label on May 3, 2023, 6:27 AM
tobiu
tobiu May 3, 2023, 6:53 AM

Hi @PriyankaTakalkar!

The question is based on which logic? :)

https://html.spec.whatwg.org/multipage/input.html#telephone-state-(type=tel) says that there is no generic recommendation, since phone numbers vary too much for given countries.

We can provide a basic input pattern like only allowing numbers and + (at the start) and maybe () and -. However, for your project, we do need more input if we want to enforce something more strict like the form field placeholder syntax.

Adding Max here as well: @mxmrtns.

tobiu referenced in commit 5f152d7 - "form.field.Phone : Phone number validation is required #4368" on May 3, 2023, 2:45 PM
tobiu
tobiu May 3, 2023, 2:46 PM

super simplified: inputPattern: /^[0-9\-+\(\) ]+$/,

feel free to add smarter solutions

tobiu closed this issue on May 3, 2023, 2:46 PM