Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there any way to move to the next row in a cfloop query without restarting the loop?

Explorer ,
Jan 24, 2013 Jan 24, 2013

I am attempting to create a table of checkboxes 4 checkboxes wide with about 40 possible query rows to output.

I'd like to <cfnext> my cfloop after outputting each <td> in a row, but I don't see a way to do that.  I haven't even begun to think about how I will read this back in my action form and update the database.  I am considering giving up on it as not possible in ColdFusion.

Any helpful information would be appreciated.

TOPICS
Advanced techniques
948
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2013 Jan 24, 2013

It sounds like you want to use nested loops.  Something like this:

checkboxes = "f1,f2,f3,f4";

<cfoutput query="yourQuery">

<tr>

<cfloop list="#checkboxes#" index="ThisCheckbox">

<td>

<input type="checkbox" name="checkbox#idFieldInYourQuery#" value = "#yourquery[ThisCheckBox][currentrow]#"> #SomethingElseFromYourQuery#

</td>

</cfloop>

</tr>

</cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 24, 2013 Jan 24, 2013

Thanks for the input. I found another solution searching google.  Conditionally closing and opening the table row based on RecordCount MOD 4 EQ 0.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2013 Jan 24, 2013
LATEST

Sounds like I misinterpreted your question.

You figured out how to process them yet?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources