[Mapbender-commits] r6808 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 25 10:04:37 EDT 2010


Author: armin11
Date: 2010-08-25 14:04:37 +0000 (Wed, 25 Aug 2010)
New Revision: 6808

Modified:
   trunk/mapbender/http/javascripts/mod_coordsLookup.js
Log:
Correct simple validation - thanx to christoph

Modified: trunk/mapbender/http/javascripts/mod_coordsLookup.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_coordsLookup.js	2010-08-25 13:25:07 UTC (rev 6807)
+++ trunk/mapbender/http/javascripts/mod_coordsLookup.js	2010-08-25 14:04:37 UTC (rev 6808)
@@ -122,7 +122,7 @@
 		if(this.coords.x.length === 0 || isNaN(this.coords.x)) {
 			this.regexdms.exec(this.coords.x);
 			//alert(RegExp.$1 + ";" + RegExp.$2 + ";" + RegExp.$3);
-			if (isNaN(RegExp.$1) || isNaN(RegExp.$2) || isNaN(RegExp.$3))
+			if (isNaN(parseFloat(RegExp.$1)) || isNaN(parseFloat(RegExp.$2)) || isNaN(parseFloat(RegExp.$3)))
 			{
 				alert('Invalid X coordinate! Must be a float or a DMS value!');
 				return;
@@ -133,7 +133,7 @@
 		if(this.coords.y.length === 0 || isNaN(this.coords.y)) {
 			this.regexdms.exec(this.coords.y);
 			//alert(RegExp.$1 + ";" + RegExp.$2 + ";" + RegExp.$3);
-			if (isNaN(RegExp.$1) || isNaN(RegExp.$2) || isNaN(RegExp.$3))
+			if (isNaN(parseFloat(RegExp.$1)) || isNaN(parseFloat(RegExp.$2)) || isNaN(parseFloat(RegExp.$3)))
 			{
 				alert('Invalid Y coordinate! Must be a float or a DMS value!');
 				return;



More information about the Mapbender_commits mailing list