2007-11-01 Igor Zelmanovich <igorz@mainsoft.com>
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Thu, 1 Nov 2007 09:37:50 +0000 (09:37 -0000)
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Thu, 1 Nov 2007 09:37:50 +0000 (09:37 -0000)
* WebUIValidation_2.0.js: fixed ToInteger function.
value such '10.00' is not converted to integer.

svn path=/trunk/mcs/; revision=88629

mcs/class/System.Web/resources/ChangeLog
mcs/class/System.Web/resources/WebUIValidation_2.0.js

index a338b83b9724ddf8ed7af571d0b5ea06ee84a50a..7019ae5b884cef863d0882d494bed2a7658a9191 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-01 Igor Zelmanovich <igorz@mainsoft.com>
+
+       * WebUIValidation_2.0.js: fixed ToInteger function.     
+       value such '10.00' is not converted to integer. 
+
 2007-09-29  Marek Habersack  <mhabersack@novell.com>
 
        * WebUIValidation_2.0.js: replace all the ocurrences of 'this' with
index b317a7b788aac5d87e155263b8cd3c7aeea60821..1c0495ea88f013f1757a990590620afc8b4fcf83 100644 (file)
@@ -280,10 +280,10 @@ webForm.IsInVisibleContainer = function (ctrl) {
 
 webForm.ToInteger = function  (s, validator)
 {
-       if ((v = parseInt(s, 10)) != s - 0)
+       if (s.match(/^\s*[-\+]?\d+\s*$/) == null)
                return null;
-       else
-               return v;
+       var v = parseInt(s, 10);
+       return (isNaN(v) ? null : v);
 }
 
 webForm.ToString = function (s, validator)