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;