BUG 9288 I add key '-' to currency Int

I add validation to currency Int
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-10-09 10:16:19 -04:00
parent 5c710ad80d
commit 73a11b4425

View File

@@ -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;