* WebUIValidation_2.0.js: fixed ToInteger function.
value such '10.00' is not converted to integer.
svn path=/trunk/mcs/; revision=88629
+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
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)