Not seeing how I have an object expected error. A second pair of eyes reviewing it is much appreciated! If I just alert the length of the radio button I receive the correct value. I only error when I have the for loop.
<html>
<head>
<title>Find Lakes</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<script language="JavaScript" type="text/javascript">
function updateLake() {
var found_it;
var myinfoArray;
for (i=0; i<document.lakes.lakename.length; i++) {
if (document.lakes.lakename.checked) {
// parse value and return values to window
myinfoArray = document.lakes.lakename.value.split(,);
window.opener.document.forms[0].bodyofwater.value = myinfoArray[0];
window.opener.document.forms[0].county.value = myinfoArray[1];
window.opener.document.forms[0].lakeID.value = myinfoArray[2];
}
}
self.close();
}
</script>
</head>
<body>
<div align="center">
<p><b>Lake Results</b></p>
<!--- IF THERE ARE NO RESULTS --->
<cfif #qfindLakes.recordcount# is 0>
<h1>No records found</h1>
</cfif>
<form action="findlakes.cfm" method="post" name="lakes" id="lakes">
<table border="0">
<tr>
<th> </th>
<th>Angler</th>
<th nowrap="nowrap">Body of Water</th>
<th>County</th>
<th>DNR LakeID</th>
</tr>
<cfoutput query="qfindLakes">
<tr>
<td><input type="radio" name="lakename" value="#Location#,#County#,#LakeID#"></td>
<td>#Angler#</td>
<td>#Location#</td>
<td>#County#</td>
<td>#LakeID#</td>
</tr>
</cfoutput>
<tr>
<td colspan="5" align="center"><input name="done" type="button" value="Done" onClick="updateLake();"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
<html>
<head>
<title>Find Lakes</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<script language="JavaScript" type="text/javascript">
function updateLake() {
var found_it;
var myinfoArray;
for (i=0; i<document.lakes.lakename.length; i++) {
if (document.lakes.lakename.checked) {
// parse value and return values to window
myinfoArray = document.lakes.lakename.value.split(,);
window.opener.document.forms[0].bodyofwater.value = myinfoArray[0];
window.opener.document.forms[0].county.value = myinfoArray[1];
window.opener.document.forms[0].lakeID.value = myinfoArray[2];
}
}
self.close();
}
</script>
</head>
<body>
<div align="center">
<p><b>Lake Results</b></p>
<!--- IF THERE ARE NO RESULTS --->
<cfif #qfindLakes.recordcount# is 0>
<h1>No records found</h1>
</cfif>
<form action="findlakes.cfm" method="post" name="lakes" id="lakes">
<table border="0">
<tr>
<th> </th>
<th>Angler</th>
<th nowrap="nowrap">Body of Water</th>
<th>County</th>
<th>DNR LakeID</th>
</tr>
<cfoutput query="qfindLakes">
<tr>
<td><input type="radio" name="lakename" value="#Location#,#County#,#LakeID#"></td>
<td>#Angler#</td>
<td>#Location#</td>
<td>#County#</td>
<td>#LakeID#</td>
</tr>
</cfoutput>
<tr>
<td colspan="5" align="center"><input name="done" type="button" value="Done" onClick="updateLake();"></td>
</tr>
</table>
</form>
</div>
</body>
</html>