-
I'm trying to use a function to grab client side variables but I am very discouraged and ready to admit defeat. The three things that retard me are:
A. How do I send the request to the function from a dynamicly made hyperlink
B. How do I get it back
C. and how do I put these variables into the querystring
Can anyone help before I request a demotion at work.
code:
<HTML><HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function blah()
{
var strURL;
strURL = Tcode.options(Tcode.selectedIndex).innerText;
strURL2 = pass.value;
blah = "header.asp?Joe.Tcode=" + strURL + "&" + "Joe.pass=" + strURL2;
}
-->
</SCRIPT></HEAD>
<BODY>
<!--Do all the DB Connect stuff here-->
<%Set QueryD = Connect.Execute (Qstr)%>
<%Do Until QueryD.EOF%>
<TR>
<td><b>
<a href=<%=QueryD("Stuff")%>?OnClick=(blah)>
Request for <%=QueryD("Stuff")%></b><br></a>
<%QueryD.MoveNext%>
<%loop%>
</td></TR></Table><P>
</BODY>
</HTML>
-
Well.. I can't help you on the demotion request decision.. but I think I see what your trying to do:
Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function blah()
{
var strURL;
//I'm assuming the Tcode and pass elements are defined somewhere that you just didn't include...
strURL = Tcode.options(Tcode.selectedIndex).innerText;
strURL = "header.asp?Tcode=" + strURL + "&" + "pass=" + pass.value;
//Don't use periods in your querystring names- keep it simple
location.href=strURL
}
-->
</SCRIPT>
</HEAD>
<BODY>
<!--Do all the DB Connect stuff here-->
<%Set QueryD = Connect.Execute (Qstr)%>
<TABLE>
<%Do Until QueryD.EOF%>
<TR>
<td>
<b><a href="javascript:blah()">
Request for <%=QueryD("Stuff")%></a></b><br>
</td>
</TR>
<%QueryD.MoveNext%>
<%loop%>
</Table>
</BODY>
</HTML>