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

hyperlink in dropdown

Status
Not open for further replies.

paulcarey

Programmer
Jun 15, 2001
45
GB
can anyone sort this for me. The first "write line where I try to specify te option value. So far I've managed to display the value but not as the hyperlink. Very frustrating!!

Cheers!

rs.Open Sql, conn
response.write(&quot;<form>&quot;)
response.write(&quot;<select size=3>&quot;)
do until rs.EOF
for each x in rs.Fields
with Response
.write(&quot;<option value=&quot;<a href='eventDefault.asp?eventcode=&quot;& sectionId &&quot;&store=&quot;& newV2 &&quot;&eventdate=&quot;& d1 &&quot;&event=&quot;& x.value &&quot;&hWeek=&quot;& week&&quot;&hYear=&quot;& year &&quot;'>&quot;&quot;)
.write(x.value)
.write(&quot;</a></option>&quot;)
end with
next
rs.MoveNext
loop
rs.close
response.write(&quot;</select>&quot;)
response.write(&quot;</form>&quot;)
 
rs.Open Sql, conn
response.write(&quot;<form>&quot;)
response.write(&quot;<select style='color:blue; text-decoration:underline' size=3 onchange='location.href=this.value'>&quot;)
do until rs.EOF
for each x in rs.Fields
with Response
.write(&quot;<option value=&quot;'eventDefault.asp?eventcode=&quot;& sectionId &&quot;&store=&quot;& newV2 &&quot;&eventdate=&quot;& d1 &&quot;&event=&quot;& x.value &&quot;&hWeek=&quot;& week&&quot;&hYear=&quot;& year &&quot;'>&quot;&quot;)
.write(x.value)
.write(&quot;</a></option>&quot;)
end with
next
rs.MoveNext
loop
rs.close
response.write(&quot;</select>&quot;)
response.write(&quot;</form>&quot;)

you dont need the style='color:blue; text-decoration:underline' I just added to format the text to look like links.

The all important part is the onchange event it call location.href=this.value, this will send you off to the link specified in the selected option value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top