can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r9570: LJSUP-6976: fixed phone checking code

Committer: dpetrov
LJSUP-6976: fixed phone checking code
U   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));
 	}
 

Tags: can3p, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments