Skip to main content
Inspiring
August 7, 2009
Question

valuelist question

  • August 7, 2009
  • 3 replies
  • 674 views

I use valuelist to display a list of values :

#valuelist(qry.qualifierText, ", ")#

However, it will display continually across the page until it runs out of room, then wraps to the next line and continue until done.

How can I define it so that it will display only five on one line, then skip and dispaly the next five, then skip, etc. until completed ?

    This topic has been closed for replies.

    3 replies

    Inspiring
    August 12, 2009

    Use arrays.  "Lists" are faked with commas.  ColdFusion does not have a genuine "list" data-type.

    Inspiring
    August 11, 2009

    You could also get away with a crafty regular expression that places a "<br/>" just before every fifth comma.   Something like this:

    #ReReplace(sValueList, "(([^,]*,){5})", "$1<br/>", "all")#

    Inspiring
    August 7, 2009

    Don't use valuelist.  Use cfoutput query = yourquery.  Use the mod operator to decide where to put your line breaks.