Frontmatter
| id | 4368 |
| title | form.field.Phone : Phone number validation is required |
| state | Closed |
| labels | enhancement |
| assignees | [] |
| createdAt | May 3, 2023, 6:27 AM |
| updatedAt | May 3, 2023, 2:46 PM |
| githubUrl | https://github.com/neomjs/neo/issues/4368 |
| author | PriyankaTakalkar |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | May 3, 2023, 2:46 PM |
form.field.Phone : Phone number validation is required

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
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
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.