Committer: dpetrov
LJSUP-6976: fixed phone checking codeU trunk/htdocs/js/editprofile.js
Modified: trunk/htdocs/js/editprofile.js =================================================================== --- trunk/htdocs/js/editprofile.js 2010-09-30 10:36:35 UTC (rev 9569) +++ trunk/htdocs/js/editprofile.js 2010-10-01 03:16:58 UTC (rev 9570) @@ -4,7 +4,8 @@ $.fn.maskInput = function(options) { var mask = /^(\+?[7]|8)\d{10}$/, - allowedChars = "0-9"; + allowedChars = "0-9", + stripChars = "()\\- "; var lastValue; function checkDEF(val) @@ -16,7 +17,7 @@ function processInput(ev) { - var val = $.trim(this.value).replace(new RegExp("[^" + allowedChars + "]", "g"),""); + var val = $.trim(this.value).replace(new RegExp("[" + stripChars + "]", "g"),""); if(typeof lastValue == undefined || lastValue != val) { options.update(mask.test(val), checkDEF(val)); @@ -24,7 +25,8 @@ } } - this.input(processInput); + this.input(processInput) + .attr('autocomplete', 'off'); processInput.call(this.get(0)); }