From f411025cef83276e66b13a30420876cfbd457fc6 Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Fri, 25 May 2007 09:12:30 +0000 Subject: [PATCH] =?utf8?q?Stricktere=20=C3=9Cberwachung=20der=20Nummernfor?= =?utf8?q?mate=20eingef=C3=BChrt.=20Auch=201000,00=20wird=20bei=20Formaten?= =?utf8?q?=20wie=201,000.00=20und=201.000,00=20jetzt=20als=20falsch=20erka?= =?utf8?q?nnt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/common.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/js/common.js b/js/common.js index ffbcd43cd..d4d5ab7b9 100644 --- a/js/common.js +++ b/js/common.js @@ -57,9 +57,12 @@ function check_right_number_format(input_name) { thnumbers[thnumbers.length-1] = thnumbers[thnumbers.length-1].substring((thnumbers[thnumbers.length-1].lastIndexOf(",") !== -1 ? thnumbers[thnumbers.length-1].lastIndexOf(",") : thnumbers[thnumbers.length-1].length), 0); } - for(var i = 1; i < thnumbers.length; i++) { - if(thnumbers[i].length !== 3) { - return show_alert_and_focus(input_name, wrongNumberFormat+thnumbers); + for(var i = 0; i < thnumbers.length; i++) { + if(i == 0 && thnumbers[i].length > 3) { + return show_alert_and_focus(input_name, wrongNumberFormat); + } + if(i > 0 && thnumbers[i].length != 3) { + return show_alert_and_focus(input_name, wrongNumberFormat); } } } @@ -71,11 +74,11 @@ function check_right_number_format(input_name) { } if(decnumbers.length == 2) { if(decnumbers[1].length > 2) { - return show_alert_and_focus(input_name, wrongNumberFormat + decnumbers); + return show_alert_and_focus(input_name, wrongNumberFormat); } } else { - if(decnumbers.length > 1 || decnumbers.length == 0) { + if(decnumbers.length > 2) { return show_alert_and_focus(input_name, wrongNumberFormat); } if(!thpoint) { @@ -133,7 +136,7 @@ function getDateArray(input_name) { function show_alert_and_focus(input_name, errorMessage) { input_name.select(); - alert(errorMessage + "\n\r\n\r--> " + input_name.value); // + "\ndecpoint: " + decpoint + "\nthpoint: " + thpoint + alert(errorMessage + "\n\r\n\r--> " + input_name.value); input_name.focus(); return false; } -- 2.20.1