$(window).on("keydown", function (e) { if (e.keyCode == 116 /*|| e.keyCode == 123*/) { prv(); return false; } if (e.keyCode == 119 && typeof (save) == "function" && $("#layermessage:visible").length < 1) { save(); } else if (e.keyCode == 115 && typeof (del) == "function" && $("#layermessage:visible").length < 1) { del(); } else if (e.keyCode == 13 && $("#confirmbox:visible").length > 0) { confirmok(); } else if (e.keyCode == 27 && $("#confirmbox:visible").length > 0) { confirmtoggle(); } else if (e.keyCode == 27 && $("#layermessage:visible").length > 0) { $(_focusitem).focus(); hidelayermsg(); } }); $(document).ready(function () { //$("body").on("blur", "input[type='text'],input[type='password']", function () { // //$("body").focus(); //}); $("body").on("keydown", ".int, .intdot", function (e) { //109,189 }).on("keyup", ".int, .intdot, input.mobile,input[type='text'],input[type='password']", function (e) { if (($(this).hasClass("int") || $(this).hasClass("intdot") || $(this).hasClass("mobile")) && $(this).val() !== null && $(this).val() !== '' && e.keyCode != 8 && e.keyCode != 109 && e.keyCode != 189 && e.keyCode != 46 && e.keyCode != 190 && e.keyCode != 110 && e.keyCode != 109 && e.keycode != 189 && e.keyCode != 13 && !(e.keyCode > 47 && e.keyCode < 58) && !(e.keyCode > 95 && e.keyCode < 106)) { $(this).val($(this).val().replace(/[^0-9.-]/g, '')); if ($(this).hasClass("int") && isNaN(parseInt($(this).val(), 10))) { if (!$(this).hasClass("datazero")) { $(this).val(""); } else { $(this).val(0); } } else if ($(this).hasClass("double") && isNaN(parseFloat($(this).val()))) { if (!$(this).hasClass("datazero")) { $(this).val(""); } else { $(this).val(0); } } } if ($(this).val() == "") { if (($(this).attr("id") || "") != "" && ($(this).attr("placeholder") || "") != "" && $("#ph_" + $(this).attr("id")).length < 1) { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie < 0) { msie = ua.indexOf("Trident/"); } if (msie > -1) { $("label.phplaceholder").remove(); $("