Re: passing multiple CF vaules to a javascript variable

2004-04-14 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-14 Thread Patric Stumpe
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

Re: passing multiple CF vaules to a javascript variable

2004-04-14 Thread Joy Holman
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

RE: passing multiple CF vaules to a javascript variable

2004-04-14 Thread Dave Francis
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

passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Bryan Stevenson
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Bryan Stevenson
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Bryan Stevenson
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.

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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.

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dave Francis
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Dick Applebaum
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

Re: passing multiple CF vaules to a javascript variable

2004-04-13 Thread Joy Holman
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: ...>