Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object expected

Status
Not open for further replies.

mickeyg

Technical User
Mar 30, 2001
120
US
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=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot; />
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
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=&quot;center&quot;>
<p><b>Lake Results</b></p>
<!--- IF THERE ARE NO RESULTS --->
<cfif #qfindLakes.recordcount# is 0>
<h1>No records found</h1>
</cfif>

<form action=&quot;findlakes.cfm&quot; method=&quot;post&quot; name=&quot;lakes&quot; id=&quot;lakes&quot;>
<table border=&quot;0&quot;>
<tr>
<th>&nbsp;</th>
<th>Angler</th>
<th nowrap=&quot;nowrap&quot;>Body of Water</th>
<th>County</th>
<th>DNR LakeID</th>
</tr>
<cfoutput query=&quot;qfindLakes&quot;>
<tr>
<td><input type=&quot;radio&quot; name=&quot;lakename&quot; value=&quot;#Location#,#County#,#LakeID#&quot;></td>
<td>#Angler#</td>
<td>#Location#</td>
<td>#County#</td>
<td>#LakeID#</td>
</tr>
</cfoutput>
<tr>
<td colspan=&quot;5&quot; align=&quot;center&quot;><input name=&quot;done&quot; type=&quot;button&quot; value=&quot;Done&quot; onClick=&quot;updateLake();&quot;></td>
</tr>
</table>
</form>
</div>
</body>
</html>
 
Hello mickeyg,

At least correct this one?
Code:
myinfoArray = document.lakes.lakename.value.split(&quot;,&quot;);
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top