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:
here's the link part of the code:
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 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!!