Skip to content

Commit 035a73a

Browse files
hubipedg
authored andcommitted
netteForms.js: conforms with PHP FLOAT validation (#174)
1 parent 67b1889 commit 035a73a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/assets/netteForms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@
470470
if (elem.type === 'number' && elem.validity.badInput) {
471471
return false;
472472
}
473-
val = val.replace(' ', '').replace(',', '.');
474-
if ((/^-?[0-9]*[.,]?[0-9]+$/).test(val)) {
473+
val = val.replace(/ +/g, '').replace(/,/g, '.');
474+
if ((/^-?[0-9]*\.?[0-9]+$/).test(val)) {
475475
value.value = val;
476476
return true;
477477
}

0 commit comments

Comments
 (0)