I have one text field, it can have values ββas 1 or 1,2 or 1,225,345,21, i.e. several meanings. But now I want to check this input.
toString().match(/^(([0-9](,)?)*)+$/)
This is the code I'm using. It only validates, but there is one problem when the user enters the following values:
inputval:1,22,34,25,645(true) inputval:1,22,34,25,645,(falues)
When the user enters a comma (,) as the last one, he should throw an error.
Can anyone help me?
source share