Cold Fusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingCold Fusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 7th, 2005, 09:49 AM
ddz ddz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 ddz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Hyperlinks in Drop Down Menus

I would like to create a dynamic drop down menu in which the menu items are associated with a hyperlink. So when a user clicks on a menu item, it will take the person to that web site. How can I do this? (I'd prefer not to have the user go through the extra step of hitting a GO or Submit button.) I'm able to create the menu itself OK, but don't know how to get the link portion to work.

Essentially, the database has fields for the web site address and web site description.

Here's my CF code so far:

<!--- This retrieves the links for the popular links drop-down menu. --->
<CFSTOREDPROC procedure="PLKGetPopularLinks" DATASOURCE="WEBMenuTestDSN">
<cfprocresult name="qGetPopularLinks">
</CFSTOREDPROC>

<form>
<select name="PopularPages" style="font-size: 11px">
<option selected disabled>Popular Pages</option>
<cfoutput QUERY="qGetPopularLinks">
<option value="#qGetPopularLinks.Address#">#qGetPopularLinks.Description#</option>
</cfoutput>
</select></p>
</form>

Reply With Quote
  #2  
Old January 7th, 2005, 10:22 AM
boogey__man boogey__man is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 boogey__man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 11 sec
Reputation Power: 0
The easiest way is with javascript...

Give the form a name
<form name="form">

and use onChange in your select
onChange="document.location.href = form.PopularPages.value;"

<option value="#" selected disabled>Popular Pages</option>

Reply With Quote
  #3  
Old February 3rd, 2005, 05:57 PM
Lethal007 Lethal007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 3 Lethal007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 52 sec
Reputation Power: 0
Agreed, the easiest way is through javascript.

Just change the query and attributes to your address table.

Try this code:

<cfquery name="getdocumentcategory" datasource="#request.datasource#">
SELECT *
FROM documentcategory_
ORDER BY documentcategory_name ASC
</cfquery>

<script language="javascript" type="text/javascript">
<!--
function menu_goto( menuform )
{

selecteditem = menuform.newurl.selectedIndex ;
newurl = menuform.newurl.options[ selecteditem ].value ;
if (newurl.length != 0) {
location.href = newurl ;
}
}
//-->
</script>
<form name="documentcategory_select" style="top: -30; width: 90px; padding: 0px;" class="input2">
<select name="newurl" class="input2" style="width: 90px; height: 5px; padding: 0px;" onchange="menu_goto(this.form)" >
<option value="0" selected>CATEGORY</option>
<cfoutput query="getdocumentcategory">
<option value="<A href="http://yoursiteaddress"> #yoursiteaddress">http://yoursiteaddress"> #yoursiteaddress# </option>
</cfoutput>
</select>
</form>

Reply With Quote
  #4  
Old March 14th, 2005, 03:02 PM
joeygurl44 joeygurl44 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Location: New York
Posts: 1 joeygurl44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 10 sec
Reputation Power: 0
Send a message via AIM to joeygurl44
Wink Drop Down Menu

I found some excellent code for a drop down menu, it makes it really easy to use:


http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

You change the code in the menu1/menu2 and can add as many as you like to populate the drop down fields. It's neat, and its interesting to use. If you have your headers in a box, you just use the second part of the code in the table, under the <th> tag.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingCold Fusion Development > Hyperlinks in Drop Down Menus


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap