Revision 9c477cc8
Von Wulf Coulmann vor mehr als 13 Jahren hinzugefügt
js/common.js | ||
---|---|---|
45 | 45 |
} |
46 | 46 |
|
47 | 47 |
function check_right_number_format(input_name) { |
48 |
if(decpoint == thpoint) {
|
|
48 |
if(decpoint && thpoint && thpoint == decpoint) {
|
|
49 | 49 |
return show_alert_and_focus(input_name, wrongNumberFormat); |
50 | 50 |
} |
51 | 51 |
var test_val = input_name.value; |
... | ... | |
55 | 55 |
if(thpoint && thpoint == '.'){ |
56 | 56 |
test_val = test_val.replace(/\./g, ''); |
57 | 57 |
} |
58 |
if(thpoint && decpoint == ','){
|
|
58 |
if(decpoint && decpoint == ','){
|
|
59 | 59 |
test_val = test_val.replace(/,/g, '.'); |
60 | 60 |
} |
61 |
|
|
62 | 61 |
var forbidden = test_val.match(/[^-\+\/\*\.0-9\ ]/g ); |
63 | 62 |
if (forbidden && forbidden.length > 0 ){ |
64 | 63 |
return show_alert_and_focus(input_name, wrongNumberFormat); |
Auch abrufbar als: Unified diff
fix js number test