Re: passing multiple CF vaules to a javascript variable
But the onClick event doesn't recognize the CF variable. It has to be _javascript_. When I convert the #linkStyle# to _javascript_ -target(){return #linkStyle#} - and place the _javascript_ in the onClick event as (target(), there is no way for the value to change from what was originally returned in the script. If the value of #linkstyle# returned in the script was FellSvc, (probably the last value returned from the query), each instance of I'm thinking I need to loop over the variable from within the script or loop over the function from within the output of the query - loop over something, somehow, to get all the values for #linkSvc# separated out and into different onClick event instances. I tried placing all the values for #linkSvc# in a list, in an array (which the _javascript_ function didn't like because it was a complex datatype), but it's not getting me closer to placing different values in each onClick event generated by outputting the query results. I'm going to sleep on it. G'night, all and thanks for your input! On Apr 13, 2004, at 1:07 PM, Joy Holman wrote: but #linkStyle# is just the name of a CF variable, a container, if you will (this one just cones from the db). that container can contain anything you want it to, for example: cfset #linkStyle# = ' html head cfscript language=_javascript_ myFunction( ) { alert(Hi); } ' / so in your example, the columns in the current row of the query contain: columnName Content -- --- linkNameApple linkURL www.apple.com linkStyleMinorRts if column named linkStyle in the current row of the database contains MinorRts then outputting: bra href="" #linkName# /a will yield: bra href="" Apple /a As I understand it, that is exactly what you want. The next row will have different values so the next link will reflect this HTH Dick script language=_javascript_ !-- window.open = SymRealWinOpen; //-- /script [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Hi Joy, could you possibly make a dump of your query? So we can understand what you data looks like? Patric JH onClick didn't understand a CF variable like: #linkStyle#. It wants _javascript_. I don't know how to make the _javascript_ variable I create from the CF variable return each of the different JH values in the onClick event. JH I get: menu item one: ...> menu item two: ...> menu item two: ...> JH How can I make the _javascript_ variable I create from the CF variable loop through the values properly? JH Thanks for trying to help with this problem. But by the time the code gets to the browser, #linkStyle#will have been replaced by exactly what you show us here menu item one: ...> menu item two: ...> menu item two: ...> view source from your browser might help clear things up for you. Or like Dick, I don't understand :( - Original Message - From: Joy Holman To: CF-Talk Sent: Tuesday, April 13, 2004 4:12 PM Subject: Re: passing multiple CF vaules to a _javascript_ variable Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using Dick's example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I need to be gone for a few hours, but I'll check back. Thank you and Dick so much for sticking with me on this!!! It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the
Re: passing multiple CF vaules to a javascript variable
Hi Patric, I'll try to consolidate information I've provided so far. I'm not at work today so I can't generate the exact code, but I'll do my best to simulate it. Here goes: Purpose of the code: When a user clicks on a menu link (generated by the CF code prior to the user interaction), an associated DIV, with an ID equal to the stylename, displays the link's content. This is because the onClick event tells the matching style in the stylesheet to change display=none to display=block. These are a sample of the values in the stylesheet: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} The names of these styles are included as a column menu_bmarkLink in the db table. Other relevant columns in the db table are: menu_Text and menu_nonBmarkLink. (menu_nonBmarkLink is included in the query for a condition where a link doesn't have a bookmark, but has an external link instead. I don't think that matters for this post.) The query is something like this: cfquery name=q_menu dbname=faqmch Select * from faq_menulinks /cfquery The output would be something like this: menu_Textmenu_bmarkLinkmenu_nonBmarkLink link1MinorRts link2FellSvc link3AmnInf link4AnteSter link5http://gosomewhereelse.com My output would be inserted into HTML list items something like this: cfoutput query=q_menu liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li /cfoutput which could produce output like: liA HREF="" liA HREF="" liA HREF="" liA HREF="" liA HREF="" /a /li For links 1-4, the #Ans is the position in the screen where the content is displayed now that the onClick target style is set to display=block. (As mentioned previously, there is a div with the same name as the style that contains the content. Something like this: div id=MinorRtsA minor has a lot of rights but they never think they have enough. They think they're old enough to make decisions for themselves, but some of those decisions could be deadly. a href="" content/a/div If the solution to my problem is including another set of cfoutput tags somewhere in this code so that the value for:#menu_bmarkLink# displays properly (a different value for it in each list item instance), then great. cfoutput query=q_menu liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li /cfoutput I got on this not-so-wild ride, when I got an error on the output codeabove saying something like, onClick didn'tunderstand the variable. I took the tact of trying to make the #menu_bmarkLink# a js variable - which worked, but only to the extent that it returned only one value for the variable and repeated that value in each instance of a generated list item. Can you help? Appreciatively, Joy Hi Joy, could you possibly make a dump of your query? So we can understand what you data looks like? Patric JH onClick didn't understand a CF variable like: #linkStyle#. It wants _javascript_. I don't know how to make the _javascript_ variable I create from the CF variable return each of the different JH values in the onClick event. JH I get: menu item one: ...> menu item two: ...> menu item two: ...> JH How can I make the _javascript_ variable I create from the CF variable loop through the values properly? JH Thanks for trying to help with this problem. But by the time the code gets to the browser, #linkStyle#will have been replaced by exactly what you show us here menu item one: ...> menu item two: ...> menu item two: ...> view source from your browser might help clear things up for you. Or like Dick, I don't understand :( - Original Message - From: Joy Holman To: CF-Talk Sent: Tuesday, April 13, 2004 4:12 PM Subject: Re: passing multiple CF vaules to a _javascript_ variable Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using Dick's example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I
RE: passing multiple CF vaules to a javascript variable
Hi Joy, It looks like your query results must not be what you expect. I've included a skeleton example of what I think you're aiming for, but which loops through a list since I don't have your data. HTML HEAD TITLEUntitled/TITLE style type=text/css #aaa {display:none;} #bbb {display:none;} #ccc {display:none;} /style /HEAD BODY cfset menu_bmarkLinkList=aaa,bbb,ccc cfloop list=#menu_bmarkLinkList# index=menu_bmarkLink brcfoutputa href=""> > /a /cfloop div id=aaaI am aaa/div div id=bbbI am bbb/div div id=cccI am ccc/div /BODY /HTML -Original Message- From: Joy Holman [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 12:12 PM To: CF-Talk Subject: Re: passing multiple CF vaules to a _javascript_ variable Hi Patric, I'll try to consolidate information I've provided so far. I'm not at work today so I can't generate the exact code, but I'll do my best to simulate it. Here goes: Purpose of the code: When a user clicks on a menu link (generated by the CF code prior to the user interaction), an associated DIV, with an ID equal to the stylename, displays the link's content. This is because the onClick event tells the matching style in the stylesheet to change display=none to display=block. These are a sample of the values in the stylesheet: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} The names of these styles are included as a column menu_bmarkLink in the db table. Other relevant columns in the db table are: menu_Text and menu_nonBmarkLink. (menu_nonBmarkLink is included in the query for a condition where a link doesn't have a bookmark, but has an external link instead. I don't think that matters for this post.) The query is something like this: cfquery name=q_menu dbname=faqmch Select * from faq_menulinks /cfquery The output would be something like this: menu_Textmenu_bmarkLinkmenu_nonBmarkLink link1MinorRts link2FellSvc link3AmnInf link4AnteSter link5http://gosomewhereelse.com My output would be inserted into HTML list items something like this: cfoutput query=q_menu liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans > /a /li /cfoutput which could produce output like: liA HREF="" > liA HREF="" > liA HREF="" > liA HREF="" > liA HREF="" /a /li For links 1-4, the #Ans is the position in the screen where the content is displayed now that the onClick target style is set to display=block. (As mentioned previously, there is a div with the same name as the style that contains the content. Something like this: div id=MinorRtsA minor has a lot of rights but they never think they have enough. They think they're old enough to make decisions for themselves, but some of those decisions could be deadly. a href=""> content/a/div If the solution to my problem is including another set of cfoutput tags somewhere in this code so that the value for:#menu_bmarkLink# displays properly (a different value for it in each list item instance), then great. cfoutput query=q_menu liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans > /a /li /cfoutput I got on this not-so-wild ride, when I got an error on the output code above saying something like, onClick didn'tunderstand the variable. I took the tact of trying to make the #menu_bmarkLink# a js variable - which worked, but only to the extent that it returned only one value for the variable and repeated that value in each instance of a generated list item. Can you help? Appreciatively, Joy Hi Joy, could you possibly make a dump of your query? So we can understand what you data looks like? Patric JH onClick didn't understand a CF variable like: #linkStyle#. It wants _javascript_. I don't know how to make the _javascript_ variable I create from the CF variable return each of the different JH values in the onClick event. JH I get: menu item one: ...> menu item two: ...> menu item two: ...> JH How can I make the _javascript_ variable I create from the CF variable loop through the values properly? JH Thanks for trying to help with this problem. But by the time the code gets to the browser, #linkStyle#will have been replaced by exactly what you show us here menu item one: ...> menu item two: ...> menu item two: ...> view source from your browser might help clear things up for you. Or like Dick, I don't understand :( - Original Message - From: Joy Holman To: CF-Talk Sent: Tuesday, April 13, 2004 4:12 PM Subject: Re: passing multiple CF vaules to a _javascript_ variable Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example).
passing multiple CF vaules to a javascript variable
I am outputting style name values using CF query-results. I'm making those values available to _javascript_ in a variable so I can use the values in an onClick event. If I only needed the variable's last style name value returned by the query, I could use the following: cfoutput script language=_javascript_ type=text/_javascript_ !-- function targetid(){ return #menu_bmarkLink#; } -- /script /cfoutput cfoutput query=Q_menu li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans > ext# /a /li /cfoutput The complication arises because I want each iteration of the onClick event to hold a different value for the style name variable. What do I have to do to iterate through the style name values from the query so each onClick event iteration has a different value - like this: liA HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans /cfif#q_menu.menu_Text# /a /li li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans /cfif#q_menu.menu_Text# /a /li li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans /cfif#q_menu.menu_Text# /a /li Thank you in advance!! I've got an app in development that hinges on this code!!! [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
You can do what you want -- but I can't understand your code -- so here goes cfquery name=getStyle SELECT styleName FROM styleDB /cfquery cfoutput query=getStyle brsome stuff #styleName# some other stuff /cfoutput will provide getStyle.RecordCount linesof output, 1 for each row in the query the #styleName# in each line of output will contain the styleName corresponding to the one in getStyle.CurrentRow HTH Dick On Apr 13, 2004, at 5:07 AM, Joy Holman wrote: I am outputting style name values using CF query-results. I'm making those values available to _javascript_ in a variable so I can use the values in an onClick event. If I only needed the variable's last style name value returned by the query, I could use the following: cfoutput script language=_javascript_ type=text/_javascript_ !-- function targetid(){ return #menu_bmarkLink#; } -- /script /cfoutput cfoutput query=Q_menu li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans > ext# /a /li /cfoutput The complication arises because I want each iteration of the onClick event to hold a different value for the style name variable. What do I have to do to iterate through the style name values from the query so each onClick event iteration has a different value - like this: liA HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans > /cfif#q_menu.menu_Text# /a /li li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans > /cfif#q_menu.menu_Text# /a /li li A HREF="" cfif q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink# cfelse##Ans /cfif#q_menu.menu_Text# /a /li Thank you in advance!! I've got an app in development that hinges on this code!!! [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
I'm placing the query results of several fields into an HTML list. The href of each generated link includes an onClick event. Because of that, I need to create a _javascript_ variable that holds the values of the style name field from the query. I don't know how to populate the style name variable for each list item. Thanks for your interest and your assistance. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Some sample code would really help here as JS is picky about syntax. That said... I'll assume you're popping open a window ;-) here's some psuedo-code cfoutput > /cfoutput Then have a _javascript_ function in the HEAD block that takes 2 arguments.So all you're doing is setting the values of the arguments passed to the function with CF vars. Hope that helps Cheers 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 8:44 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable I'm placing the query results of several fields into an HTML list. The href of each generated link includes an onClick event. Because of that, I need to create a _javascript_ variable that holds the values of the style name field from the query. I don't know how to populate the style name variable for each list item. Thanks for your interest and your assistance. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
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]
Re: passing multiple CF vaules to a javascript variable
where do you want to loop thru the style name? 1) when creating the html/js with CF/ 2) when the user initiates the js onClick? if 1) above, where what format is the list of styles? Dick On Apr 13, 2004, at 9:23 AM, Joy Holman wrote: 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]
Re: passing multiple CF vaules to a javascript variable
Yes, I want to output the stylenames as the html code is generated. 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. cfqueryname=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 liAHREF="" 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: liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" q_menu.menu_nonBmarkLink neq#q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" 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 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
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]
Re: passing multiple CF vaules to a javascript variable
You use a SELECT * This is usually a bad habit as it makes the SQL engine do extra work degrades performance -- in this case, it also causes confusion.' What is the name of the column in the query that contains the style name? Dick On Apr 13, 2004, at 9:53 AM, Joy Holman wrote: Yes, I want to output the stylenames as the html code is generated. 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 liA 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: liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liA HREF="" q_menu.menu_nonBmarkLink neq#q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liA 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 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Yes, I want to output the stylenames as the html code is generated. 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. cfqueryname=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 liAHREF="" 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: liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" q_menu.menu_nonBmarkLink neq#q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" 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]
Re: passing multiple CF vaules to a javascript variable
Yes, I want to output the stylenames as the html code is generated. 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. cfqueryname=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 liAHREF="" 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: liA HREF="" q_menu.menu_nonBmarkLink neq #q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" q_menu.menu_nonBmarkLink neq#q_menu.menu_nonBmarkLink#cfelse##Ans /a /li liAHREF="" q_menu.menu_nonBmarkLink neq#q_menu.menu_nonBmarkLink# cfelse##Ans /li Thanks. Joy where do you want to loop thru the style name? 1) when creating the html/js with CF/ 2) when the user initiates the js onClick? if 1) above, where what format is the list of styles? Dick On Apr 13, 2004, at 9:23 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
menu_bmarkLink is the name of the column in the query that contains the style name You use a SELECT * This is usually a bad habit as it makes the SQL engine do extra work degrades performance -- in this case, it also causes confusion.' What is the name of the column in the query that contains the style name? Dick On Apr 13, 2004, at 9:53 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: menu_bmarkLink is the name of the column in the query that contains the style name You use a SELECT * This is usually a bad habit as it makes the SQL engine do extra work degrades performance -- in this case, it also causes confusion.' What is the name of the column in the query that contains the style name? Dick On Apr 13, 2004, at 9:53 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. >From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
I realize that you are trying to create a list of links -- what I can't understand is where the dynamic data is supposed to come from I would write something like: cfquery name=menu SELECTlinkName, linkURL, linkStyle FROM linkTable /cfquery yields a query containing: linkName linkURL linkStyle -- Apple www.apple.com colorful Macromediawww.macromedia.comflashy Microsoftwww.microsoft.comopportunistic Now, iterating over the query: cfoutput query=menu bra href="" style=#linkStyle# #linkName# /a /cfoutput yields: bra href="" style=colorful Apple /a bra href="" style=flashy Macromedia /a bra href="" style=opportunistic Microsoft /a I know this is not exactly what you want, but using the same technique, can you show me what you want? Dick On Apr 13, 2004, at 11:55 AM, Joy Holman wrote: The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Could you give me some pseudo code to work with? I guess this is exactly where I'm stuck. I've only got the one table and one query. Everything I need is in there. I just can't figure out how to make the value needed on the onClick event be unique for each event generated by the outputting of the query results. I don't know how to loop through the that variable's values correctly. I appreciate your help. Joy Holman It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like your example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using your example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I realize that you are trying to create a list of links -- what I can't understand is where the dynamic data is supposed to come from I would write something like: cfquery name=menu SELECTlinkName, linkURL, linkStyle FROM linkTable /cfquery yields a query containing: linkName linkURL linkStyle -- Apple www.apple.com colorful Macromediawww.macromedia.comflashy Microsoftwww.microsoft.comopportunistic Now, iterating over the query: cfoutput query=menu bra href="" style=#linkStyle# #linkName# /a /cfoutput yields: bra href="" style=colorful Apple /a bra href="" style=flashy Macromedia /a bra href="" style=opportunistic Microsoft /a I know this is not exactly what you want, but using the same technique, can you show me what you want? Dick On Apr 13, 2004, at 11:55 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using Dick's example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I need to be gone for a few hours, but I'll check back. Thank you and Dick so much for sticking with me on this!!! It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
But by the time the code gets to the browser, #linkStyle#will have been replaced by exactly what you show us here menu item one: ...> menu item two: ...> menu item two: ...> view source from your browser might help clear things up for you. Or like Dick, I don't understand :( - Original Message - From: Joy Holman To: CF-Talk Sent: Tuesday, April 13, 2004 4:12 PM Subject: Re: passing multiple CF vaules to a _javascript_ variable Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using Dick's example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I need to be gone for a few hours, but I'll check back. Thank you and Dick so much for sticking with me on this!!! It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the output of enough rows showing the columns their values that contain the dynamic data HTH Dick On Apr 13, 2004, at 10:16 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
On Apr 13, 2004, at 1:07 PM, Joy Holman wrote: Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like your example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using your example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. but #linkStyle# is just the name of a CF variable, a container, if you will (this one just cones from the db). that container can contain anything you want it to, for example: cfset #linkStyle# = ' html head cfscript language=_javascript_ myFunction( ) { alert(Hi); } ' / so in your example, the columns in the current row of the query contain: columnName Content -- --- linkNameApple linkURL www.apple.com linkStyleMinorRts if column named linkStyle in the current row of the database contains MinorRts then outputting: bra href="" #linkName# /a will yield: bra href="" Apple /a As I understand it, that is exactly what you want. The next row will have different values so the next link will reflect this HTH Dick I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I realize that you are trying to create a list of links -- what I can't understand is where the dynamic data is supposed to come from I would write something like: cfquery name=menu SELECT linkName, linkURL, linkStyle FROM linkTable /cfquery yields a query containing: linkName linkURL linkStyle -- -- -- Apple www.apple.com colorful Macromedia www.macromedia.com flashy Microsoft www.microsoft.com opportunistic Now, iterating over the query: cfoutput query=menu bra href="" style=#linkStyle# #linkName# /a /cfoutput yields: bra href="" style=colorful Apple /a bra href="" style=flashy Macromedia /a bra href="" style=opportunistic Microsoft /a I know this is not exactly what you want, but using the same technique, can you show me what you want? Dick On Apr 13, 2004, at 11:55 AM, Joy Holman wrote: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: passing multiple CF vaules to a javascript variable
onClick didn't understand a CF variable like: #linkStyle#. It wants _javascript_. I don't know how to make the _javascript_ variable I create from the CF variable return each of the different values in the onClick event. I get: menu item one: ...> menu item two: ...> menu item two: ...> How can I make the _javascript_ variable I create from the CF variable loop through the values properly? Thanks for trying to help with this problem. But by the time the code gets to the browser, #linkStyle#will have been replaced by exactly what you show us here menu item one: ...> menu item two: ...> menu item two: ...> view source from your browser might help clear things up for you. Or like Dick, I don't understand :( - Original Message - From: Joy Holman To: CF-Talk Sent: Tuesday, April 13, 2004 4:12 PM Subject: Re: passing multiple CF vaules to a _javascript_ variable Would this information help explain what I need? Here's where the styles comes in: I have a CSS stylesheet with these values: #FellSvc{display:none;} #MinorRts{display:none;} #AmnInf{display:none;} #AnteSter{display:none;} In the db table, I have a column for the same styles from the stylesheet. Let's say the column name is linkStyle (like Dick's example). Another column in the db table has the text for the menu link that displays on the page. When a user clicks on a menu link (generated by the CF code prior to the user interaction), an assoicated DIV with an ID equal to the stylename displays its content because the onClick event tells the matching style in the stylesheet to change display=none to display=block. Using Dick's example, just change the end to something like this: Now, iterating over the query: cfoutput query=menu bra href="" #linkName# /a /cfoutput Now, that doesn't work because #linkStyle# is CF and onClick needs js. I don't know how to loop through this onClick variable to get the range of values to be produced - one for each iteration of the results, like: menu item one: ...> menu item two: ...> menu item two: ...> etc. Does that help? I need to be gone for a few hours, but I'll check back. Thank you and Dick so much for sticking with me on this!!! It sounds like you need to combine the results from the 2 queries into a single query objectOR write a more complex query to join all the tables involved to produce a single recordset. 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 11:55 AM Subject: Re: passing multiple CF vaules to a _javascript_ variable The rendered output is a menu of links. One query column returns the text for a link, another query column returns the target for the link. The style name column is used in an onClick event to set a CSS style to display content when clicked. The style name doesn't display on screen. I'm able to generate all the values I need except for all the stylename values. If I only had one result from the query, it would work fine. But I can't get the style name value to change as additional menu items are generated from the query results. Maybe what I need is help with _javascript_. I don't know how to explain it any better. I guess that's a drawback of not being able to talk in real time. Thanks for your efforts. I'll keep at it. event. From the query results, I create the js: target() which returns the value of the stylename field. How do I loop over the stylename values so that I get one value per onClick event which is generates multiple times based on the number of records in the query? I am sorry... I can't understand what you are trying to do. It is a simple matter to include the value of a column from the query in a line of text generated within the output tags... But you are already doing that... Maybe this would help me to help you: 1) show me a few lines of the rendered output that you desire--- no CF tags, just the rendered output. 2) put an asterisk or something in front of each value in the rendered output that you want to dynamically create with your CF code, 3) Run your query and display the