Commit aee44ec2 authored by spawar's avatar spawar

Added changes to accept only numbers when input type is number.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106618 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0f19b705
......@@ -159,7 +159,31 @@ function openExtraContainer(gstType)
window.parent.document.getElementById("E12TransEditorContainer-layoutBtn").style.display = "none";
// alert(saveData);
// $('#gstExtraFrame').contents().find(':input[type="number"]').click(function () { alert('hello'); });
$('iframe#gstExtraFrame').load(function()
{
$('#gstExtraFrame').contents().find(':input[type="number"]').keydown(function (e)
{
// Allow: backspace, delete, tab, escape, enter and .
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
// Allow: Ctrl/cmd+A
(e.keyCode == 65 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: Ctrl/cmd+C
(e.keyCode == 67 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: Ctrl/cmd+X
(e.keyCode == 88 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: home, end, left, right
(e.keyCode >= 35 && e.keyCode <= 39))
{
// let it happen, don't do anything
return;
}
// Ensure that it is a number and stop the keypress
if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105))
{
e.preventDefault();
}
});
});
}
function hideItemDefaultEdit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment