Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unordered list

Status
Not open for further replies.

newbby

Programmer
Mar 16, 2004
36
US
How do I store an unordered list like
<ul>
<li>values</li>
<li>values</li>
<li>values</li>
</ul>
in a variable.
 
It's just an html string.

<cfset myUnOrderedList = "<ul><li>values</li><li>values</li><li>values</li></ul>">

<cfoutput>#myUnOrderedList#</cfoutput>

sounds like there may be a better way to do whatever it is you're doing. what are you trying to accomplish?

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Hi Bombboy,
Your solution works great if the unordered list is static. I have created a dynamic unordered list. eg:
<ul><cfoutput query="Myquery"><li>#values#</li></cfoutput></ul>. The above solution generates string " errors. The above file is stored in a external folder but application can include them by including the variable name.Thanks for the solution.
 
You never said that. :) it would be similar to the way you output it...

Code:
<cfset myUnorderedList = "<ul>">
<cfloop query = "myquery">
  <cfset myUnorderedList = myUnorderedList & "<li>" & myQuery.myValue & "</li>">
</cfloop>
<cfset myUnorderedList = myUnorderedList & "</ul>">
<cfoutput>#myunorderedList#</cfoutput>


A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top