Sorry, I added the list after sending the previous code. (Actually, I don't care if I have a list of the stylenames or not; I just want to get one of the style name values from the query into each of the onClick events.) The format of the list is defaulted to commas.
Here's the code with the CF list.
<cfquery name="q_menu" datasource="mchfaq">
SELECT * from qa_menu
order by menu_sortText
</cfquery>
<cfoutput>
<cfset bmarklinkList = #ValueList(q_menu.menu_bmarkLink)#>
<script language="_javascript_" type="text/_javascript_">
<!--
function targetid(){
return #bmarklinkList#;
}
-->
</script>
</cfoutput>
<ul>
<cfoutput query="q_menu">
<li><A HREF="" q_menu.menu_nonBmarkLink neq "">"#q_menu.menu_nonBmarkLink#"><cfelse>"##Ans"
</a></li>
</cfoutput>
</ul>
Basically, if the href value is an external URL, ignore the rest of the if statement. If the href value is a bookmark link, have the href go to a specific position on the page, (#Ans), and using CSS display the previously hidden content of the style names in the onClick.
I've substituted style name values where the js goes, like so:
<li><A HREF="" q_menu.menu_nonBmarkLink neq""> "#q_menu.menu_nonBmarkLink#"><cfelse>"##Ans"
</a> </li>
<li><A HREF="" q_menu.menu_nonBmarkLink neq"">"#q_menu.menu_nonBmarkLink#"><cfelse>"##Ans"
</a> </li>
<li><A HREF="" q_menu.menu_nonBmarkLink neq"">"#q_menu.menu_nonBmarkLink#">< cfelse>"##Ans"
</li>
I'd really like this to work. I think I could use this code a lot.
Thanks again.
Joy
> I didn't see any code and without it I'm afraid I'm not getting you.
> I can say that what I posted will work...it shows you the "how" to get
> the vars into JS...it's up to you to pass the correct vars based on
> your code (nested loops etc.) ;-)
>
> If you can re-post the code I'm sure the lights will come on ;-)
>
> Bryan Stevenson B.Comm.
> VP & Director of E-Commerce Development
> Electric Edge Systems Group Inc.
> t. 250.920.8830
> e. [EMAIL PROTECTED]
>
> ---------------------------------------------------------
> Macromedia Associate Partner
> www.macromedia.com
> ---------------------------------------------------------
> Vancouver Island ColdFusion Users Group
> Founder & Director
> www.cfug-vancouverisland.com
> ----- Original Message -----
> From: Joy Holman
> To: CF-Talk
> Sent: Tuesday, April 13, 2004 9:23 AM
> Subject: Re: passing multiple CF vaules to a _javascript_ variable
>
>
> I've got my code in the first post of this thread. Based on the
>
> code you've written, it looks like I would get all the values in
>
> one onClick event. I need to generate one value per onClick. Each
>
> onClick is within an <li> that holds other query results, so I
>
> can't just loop through the stylename variable within one
>
> onClick. Am I making any sense?
>
> Thanks for your help.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

