Jump to content

Dynamic links based on a Dropdown


bairdb
 Share

Recommended Posts

<%set object = Server.CreateObject("ADODB.Recordset")sql="SELECT DISTINCT Sales_St_Nm FROM SalesStateRetention WHERE subline<>'Grand Total' Order By Sales_St_Nm"object.open sql, connSales_St_Nm=request.QueryString("Sales_St_Nm")%><div style="position:absolute; top:0%; left:0%; font-weight:bold"><form method="get"><table cellspacing="0" width="100%" height="2%" bgcolor="#999999" border="1"><tr style="color:#FFFFFF;; background-color:#2A436C"><td><select name="Sales_St_Nm" onchange="submit();"><option>Select a Type</option><% do until object.EOF   response.Write("<option")   If object.fields("Sales_St_Nm") = Sales_St_Nm then   response.write(" selected")   end if   response.Write(">")   response.Write(object.fields("Sales_St_Nm"))   object.Movenextloopset object=Nothing%></select></td></tr></table></form><%if Sales_St_Nm<>"" thenset object = Server.CreateObject("ADODB.Recordset")sql="SELECT * FROM SalesStateRetention WHERE Sales_ST_NM='"& Sales_St_Nm &"' AND subline='total'"object.open sql, conn%><script type="text/javascript">function open_reg(){window.open("http://compass/clfr/Metrics_copy(1)/new%20pages/RetentionV8/<%response.write(object.fields("Sales_St_Nm"))%>.asp?subline=total"),"_blank","toolbar=no, location=no, directories=no, left=100px, top=150 status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000 height=300")}</script>

I am trying to create a javascript pop up that has a link that the page that opens is based on a selection from a dynamic dropdown, but when I try to use the link nothing happens. This is the code I have so far, if anyone could help me out it would be appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...