From 73a11b44250927c496082dba1979d140f93b4bc8 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 9 Oct 2012 10:16:19 -0400 Subject: [PATCH 1/3] BUG 9288 I add key '-' to currency Int I add validation to currency Int --- gulliver/js/form/core/form.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index 92975c644..6658f450c 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -886,7 +886,7 @@ function G_Text(form, element, name) } break; case '-': - if (me.validate == 'Real'){ + if (me.validate == 'Real' || me.validate == 'Int'){ newValue += chars[c]; newCont++; if (c + 1 == cursor.selectionStart){ @@ -987,11 +987,9 @@ function G_Text(form, element, name) action = 'none'; break; case 8: - newValue = currentValue.substring(0, cursorStart - 1); newValue += currentValue.substring(cursorEnd, currentValue.length); newCursor = cursorStart - 1; - //alert('aaa' + newValue + ' , ' + newCursor ); break; case 46: newValue = currentValue.substring(0, cursorStart); @@ -1103,12 +1101,13 @@ function G_Text(form, element, name) cursorStart = currentSel.selectionStart; cursorEnd = currentSel.selectionEnd; switch(keyCode){ - case 8: + case 8: newValue = currentValue.substring(0, cursorStart - 1); newValue += currentValue.substring(cursorEnd, currentValue.length); newCursor = cursorStart - 1; break; case 46: + case 45: newValue = currentValue.substring(0, cursorStart); newValue += currentValue.substring(cursorEnd + 1, currentValue.length); newCursor = cursorStart; @@ -1287,7 +1286,7 @@ function G_Text(form, element, name) keyValid = true; break; case 'Int': - patron = /[0-9]/; + patron = /[0-9\-]/; key = String.fromCharCode(pressKey); keyValid = patron.test(key); break; From 750ce8ad510e00b2eeaf26f0e4d892a8c97907b6 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 9 Oct 2012 10:19:11 -0400 Subject: [PATCH 2/3] BUG 9288 I add key '-' to currency Int I add validation to currency Int --- gulliver/js/form/core/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index 6658f450c..be65e29e2 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -1101,7 +1101,7 @@ function G_Text(form, element, name) cursorStart = currentSel.selectionStart; cursorEnd = currentSel.selectionEnd; switch(keyCode){ - case 8: + case 8: newValue = currentValue.substring(0, cursorStart - 1); newValue += currentValue.substring(cursorEnd, currentValue.length); newCursor = cursorStart - 1; From 7e5bbcdb39f034005747b8094b1d1d82a3a18ea4 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 10 Oct 2012 10:26:41 -0400 Subject: [PATCH 3/3] BUG 9288 I add validation to negative numbers I add validation to currency Int --- gulliver/js/form/core/form.js | 1 - 1 file changed, 1 deletion(-) diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index be65e29e2..dda581c76 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -3082,7 +3082,6 @@ var validateForm = function(sRequiredFields) { } } } - return true; } };