• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
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

Copy link to clipboard

Copied

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

Views

874

Translate

Translate

Report

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

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Sounds like I misinterpreted your question.

You figured out how to process them yet?

Votes

Translate

Translate

Report

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
Documentation