violet
04-29-2003, 05:35 PM
I need to figure out how to pass the values that have been converted (using a function) to a new page.
Can you call a function and submit the new values at the same time?
Any suggestions?
What I want to do:
1. user inputs values
2. values are converted using a function
3. converted values are passing to new page
4. converted values are entered in to database
My code so far:
<SCRIPT LANGUAGE="JavaScript">
function getMap()
{
if (navigator.appName == "Netscape")
return parent.mapframe.document.map;
else
return parent.mapframe.map;
}
function myfunction()
{
var map = getMap();
//Get the easting, northing, id and UTM zone from the form
x = document.pointType.easting.value;
y = document.pointType.northing.value;
// Convert MCS to lat/lon
var latLonPt = map.mcsToLonLat(x, y);
// pull out lat/lon vals
lon = latLonPt.getX();
lat = latLonPt.getY();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="pointType" METHOD="POST">
<CFOUTPUT>
<B>
<table border="0" width="100%" align="right" cellpadding="0" cellspacing="0">
<tr>
<td>
<FONT face="Verdana" size="1" color="white">Easting </FONT><INPUT TYPE="text" size="10" NAME="easting" style="FONT-SIZE: xx-small">
<FONT face="Verdana" size="1" color="white">Northing </FONT><INPUT TYPE="text" size="10" NAME="northing" style="FONT-SIZE: xx-small">
</CFOUTPUT>
<!--- the following code - calls function - but how do I passed the converted values (ie: lon and lat)? --->
<input type="button" value="Click Here" onclick="myfunction()">
</FORM>
</DIV>
</BODY>
</HTML>
Can you call a function and submit the new values at the same time?
Any suggestions?
What I want to do:
1. user inputs values
2. values are converted using a function
3. converted values are passing to new page
4. converted values are entered in to database
My code so far:
<SCRIPT LANGUAGE="JavaScript">
function getMap()
{
if (navigator.appName == "Netscape")
return parent.mapframe.document.map;
else
return parent.mapframe.map;
}
function myfunction()
{
var map = getMap();
//Get the easting, northing, id and UTM zone from the form
x = document.pointType.easting.value;
y = document.pointType.northing.value;
// Convert MCS to lat/lon
var latLonPt = map.mcsToLonLat(x, y);
// pull out lat/lon vals
lon = latLonPt.getX();
lat = latLonPt.getY();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="pointType" METHOD="POST">
<CFOUTPUT>
<B>
<table border="0" width="100%" align="right" cellpadding="0" cellspacing="0">
<tr>
<td>
<FONT face="Verdana" size="1" color="white">Easting </FONT><INPUT TYPE="text" size="10" NAME="easting" style="FONT-SIZE: xx-small">
<FONT face="Verdana" size="1" color="white">Northing </FONT><INPUT TYPE="text" size="10" NAME="northing" style="FONT-SIZE: xx-small">
</CFOUTPUT>
<!--- the following code - calls function - but how do I passed the converted values (ie: lon and lat)? --->
<input type="button" value="Click Here" onclick="myfunction()">
</FORM>
</DIV>
</BODY>
</HTML>