I'm using happyJS and use the regex underneath for phone validation
phone: function (val) {
return /^(?:[0-9]+$)/.test(val);
}
However this ONLY allows numbers. I want the user to be able to enter spaces as well like
238 238 45383
Any idea why return /^(?:[0-9 ]+$)/.test(val);
is not doing the trick?
/^(?:[0-9 ]+$)/.test("238 238 45383");
returns true. Seems to work. – Fortalice