Hi, Would anyone know how to populate an asp dropdown with a dependant condition.
I need this dropdown to select only artists, ie from the authortwo field where in another field, ie extrathree, the word yes is written.
somehow to combine another condition like
Any help would be great.
Thanks in advance
Richard
I need this dropdown to select only artists, ie from the authortwo field where in another field, ie extrathree, the word yes is written.
Code:
<form method="Post"> <div> <select onChange="window.location='' + this.options[this.selectedIndex].value"> <OPTION VALUE = 'artists'> artists</Option> <OPTION>-----------------------------------------------------</Option> <% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT DISTINCT AuthorTwo FROM tblGreetingPostCards ORDER BY AuthorTwo" oRs.Open strSQL, conn Do while not oRs.EOF if Request.Form("GreetingPostCards") = oRs("AuthorTwo") then 'if this is the selected one then display as selected Response.Write "<OPTION VALUE = '" & oRS ("AuthorTwo") & "' SELECTED>" Response.Write oRs("AuthorTwo") & "</Option>" oRs.MoveNext else Response.Write "<OPTION VALUE = 'http://www.mysite.com/artgallery.asp?AuthorTwo=" & oRs ("AuthorTwo") & "'> " Response.Write oRs("AuthorTwo") & "</Option>" oRs.MoveNext end if loop %> </SELECT> </div> </form>
Code:
<% If InStr(rsCard("extrathree"),"yes") > 0 Then %> <I><a href="portfol.asp?authortwo=<%=rsCard("authortwo")%>" title="">info </I><a> <% Else %> <% End If %>
Thanks in advance
Richard
Comment