changhuixu / ngx-digit-only

An Angular directive to only allow [0-9] in the input box when typing, pasting or drag/dropping.

Home Page:https://changhuixu.github.io/ngx-digit-only/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pattern not working

mniak opened this issue · comments

commented

The pattern attribute does not work

Hi @mniak ,
Could you give more context about your question?
By definition, the pattern attribute specifies a regular expression that the element's value is checked against on form submission.
If you have a form element wrap the input element, then any invalid input will stop form submission.

commented

Wow, I thought it would prevent input. Thanks for the quick response.