From 428b28896fee1117bbd38291350e3c7e9cef3fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Aydo=C4=9Fdu?= Date: Wed, 11 Jun 2014 16:51:20 +0300 Subject: [PATCH] Fixed bug about number regexp pattern When entering value like "12." , validator was returning true --- validetta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validetta.js b/validetta.js index 553253e..dccbdcc 100644 --- a/validetta.js +++ b/validetta.js @@ -27,7 +27,7 @@ // @from ( http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state-%28type=email%29 ) regMail = new RegExp( /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ ), //RegExp for input number control method - regNumber = new RegExp( /^[\-\+]?\d+\.?\d*$/ ), + regNumber = new RegExp( /^[\-\+]?\d+\.?\d+$/ ), /** * Form validate error messages */