Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/templates/aspro_next/js/ |
Upload File : |
(function ($) { $.fn.alphanumeric = function (p) { var input = $(this), az = "abcdefghijklmnopqrstuvwxyz", options = $.extend({ ichars: '!@#$%^&*()+=[]\\\';,/{}|":<>?~`.- _', nchars: '', allow: '' }, p), s = options.allow.split(''), i = 0, ch, regex; for (i; i < s.length; i++) { if (options.ichars.indexOf(s[i]) != -1) { s[i] = '\\' + s[i]; } } if (options.nocaps) { options.nchars += az.toUpperCase(); } if (options.allcaps) { options.nchars += az; } options.allow = s.join('|'); regex = new RegExp(options.allow, 'gi'); ch = (options.ichars + options.nchars).replace(regex, ''); input.keypress(function (e) { var key = String.fromCharCode(!e.charCode ? e.which : e.charCode); if (ch.indexOf(key) != -1 && !e.ctrlKey) { e.preventDefault(); } }); input.blur(function () { var value = input.val(), j = 0; for (j; j < value.length; j++) { if (ch.indexOf(value[j]) != -1) { input.val(''); return false; } } return false; }); return input; }; $.fn.numeric = function (p) { var az = 'abcdefghijklmnopqrstuvwxyz', aZ = az.toUpperCase(); return this.each(function () { $(this).alphanumeric($.extend({ nchars: az + aZ }, p)); }); }; $.fn.alpha = function (p) { var nm = '1234567890'; return this.each(function () { $(this).alphanumeric($.extend({ nchars: nm }, p)); }); }; })(jQuery);