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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript function called from link tag - unable to return value 1

Status
Not open for further replies.

nimarii

MIS
Jan 26, 2004
213
US
Hello,

I have an asp page that displays a table of records. in each record is a "View" link, that when clicked, should load another asp page with the record details.

i'm not sure how to pass the value of the selected record over to the new asp page, and i'm trying to do it by having the link's onclick event call a javascript function, and then return a value back, before linking to the specified page in the href.

here's the function:
Code:
<script language="javascript">
<!---
viewdetails(circuitid)
{
return circuitid;
}
--->
</script>

here's the link part of the code:
Code:
<%
		do while not rsCircuits.EOF
%>
			<tr><td><%=rscircuits("circuitid")%></td><td><a href="circuitdetails.asp" onclick="viewdetails(<%=rscircuits("circuitid")%>)">view</a></td></tr>
<%
			rscircuits.movenext
		loop
%>
		</table>

the problem is that when i load the page, i get the following error: line 9, char 1, 'return' statement outside of function.

Can anyone tell me what i'm doing wrong? or please advise if there's a better way to do this?

thanks!!
 
I posted solution to the similar situation in this thread333-964652 thread

go over it and let me know if you still have any problems...

-L
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top