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_Text  menu_bmarkLink   menu_nonBmarkLink
link1      MinorRts
link2      FellSvc
link3      AmnInf
link4      AnteSter
link5                       http://gosomewhereelse.com

My output would be inserted into HTML list items something like this:
<cfoutput query="q_menu">
<li><A HREF="" q_menu.menu_nonBmarkLink neq
"">"#q_menu.menu_nonBmarkLink#"><cfelse>"##Ans"
</a> </li>
</cfoutput>

which could produce output like:
<li><A HREF=""
<li><A HREF=""
<li><A HREF=""
<li><A HREF=""
<li><A 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="MinorRts">A 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">
<li><A 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). 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>
  
>
> >> ><br><a 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 object....OR 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:
   
>
> >>
  
>
> >> > >
   
>
> >>
  
>
> >> > >>
>
> JH>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to