[Vtigercrm-commits] [vtiger-commits] r10590 - /vtigercrm/branches/5.0.3/include/js/general.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 9 03:02:02 EDT 2007
Author: richie
Date: Mon Apr 9 01:01:56 2007
New Revision: 10590
Log:
* Added check for dot count ie., number field should not contain more than one dot, Fixed #3474
Modified:
vtigercrm/branches/5.0.3/include/js/general.js
Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Mon Apr 9 01:01:56 2007
@@ -651,6 +651,22 @@
else
var re=/^\d+(\.\d\d*)*$/
}
+
+ //for precision check. ie.number must contains only one "."
+ var dotcount=0;
+ for (var i = 0; i < val.length; i++)
+ {
+ if (val.charAt(i) == ".")
+ dotcount++;
+ }
+
+ if(dotcount>1)
+ {
+ alert(alert_arr.INVALID+fldLabel)
+ getObj(fldName).focus()
+ return false;
+ }
+
if (!re.test(val)) {
alert(alert_arr.INVALID+fldLabel)
getObj(fldName).focus()
More information about the vtigercrm-commits
mailing list