W
Wayne Wengert
I jave a javascript function (see below) where if I uncomment the "if
(isNaN(z)..." line, the function won't execute. I need to pass floating
point numbers to the "map.center...." call and I had also tried to use a
statement like "var xx = parseFloat(x);" and that also causes the function
not to execute?
I put in various alerts and I know that the values are valid.
What am I missing here?
Wayne
============= function ===============
<script type="text/javascript">
//<![CDATA[
var x=document.Form1.txtLat.value;
var y=document.Form1.txtLong.value;
var z =document.Form1.txtZIPToFind.value;
alert("txtLat Value is: " + document.Form1.txtLat.value);
alert("Zip length is: " + z.length);
if(z.length ==5){
if (GBrowserIsCompatible()) {
alert("In mapping function");
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
//if (isNaN(z)) { alert('Please enter a valid 5 digit ZIP code!');
return; }
//map.centerAndZoom(new GPoint(x,y, 5);
}
}
//]]>
</script>
(isNaN(z)..." line, the function won't execute. I need to pass floating
point numbers to the "map.center...." call and I had also tried to use a
statement like "var xx = parseFloat(x);" and that also causes the function
not to execute?
I put in various alerts and I know that the values are valid.
What am I missing here?
Wayne
============= function ===============
<script type="text/javascript">
//<![CDATA[
var x=document.Form1.txtLat.value;
var y=document.Form1.txtLong.value;
var z =document.Form1.txtZIPToFind.value;
alert("txtLat Value is: " + document.Form1.txtLat.value);
alert("Zip length is: " + z.length);
if(z.length ==5){
if (GBrowserIsCompatible()) {
alert("In mapping function");
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
//if (isNaN(z)) { alert('Please enter a valid 5 digit ZIP code!');
return; }
//map.centerAndZoom(new GPoint(x,y, 5);
}
}
//]]>
</script>