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

drop down hyperlink

Status
Not open for further replies.

GaryWilsonCPA

Technical User
Jul 19, 2000
253
US
Is it possible to use a drop down field and have the selected drop down field be a hyperlink? I have seen this done on webpages
 
Here is a script I've had laying around for a while.

In the header
Code:
<SCRIPT>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget==&quot;_self&quot;) {window.location=loc;}
else {if (lowtarget==&quot;_top&quot;) {top.location=loc;}
else {if (lowtarget==&quot;_blank&quot;) {window.open(loc);}
else {if (lowtarget==&quot;_parent&quot;) {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf(&quot;&&quot;);
target=&quot;&quot;;
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target=&quot;_self&quot;;};
if (ref != &quot;&quot;) {land(loc,target);}
}
//-->
</SCRIPT>

Select menu code
Code:
<select onChange=&quot;window.location=this.options[selectedIndex].value&quot; name=&quot;select&quot;>

Options
Code:
 <option value=&quot;[URL unfurl="true"]http://www.someurl.com&quot;>Some[/URL] Choice
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
I have not used a script before .. Where would I place that code? Thanks for response.

 
The stuff between
Code:
<script>and </script>
goes in the header (between the head tags).

The
Code:
<select onchange....
Is you drop down menu. Use the code to start the select menu (opening <select> tag)

The options are the options in the drop down menu. Make a simple drop down in FP and view source. It will all make sense. Replace the select tag with the one here and make your options as you see here. The first part inbetween the head tags. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top