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

CFIF selecting only last entry

New Here ,
Aug 23, 2007 Aug 23, 2007

Copy link to clipboard

Copied

I'm selecting all entries that meet the criteria of #ccdirect# = #cklstdirflg# and the radio button For N/A is selected; however, it always selects just the last entry that fits the criteria. Does anyone have a clue what I'm missing?
TOPICS
Advanced techniques

Views

572

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
Guide ,
Aug 23, 2007 Aug 23, 2007

Copy link to clipboard

Copied

If you give a set of radio buttons the same name ("cclselect") then only 1 of those radio buttons can be checked at one time.

If you want each set of YES - NO - N/A buttons to behave as a separate group, I think you'll have to name them dynamically.



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
New Here ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

I renamed all the cclselect and only the last entry is still being marked. Any other ideas?

<cfif #ccdirect# is #cklstdirflg#>

<td><input type="radio" name="filteryes" value="Yes"></td>
<td><input type="radio" name="filterno" value="No"></td>
<td><input type="radio" name="filterna" value="N/A" checked></td>
<cfelse>
<td><input type="radio" name="yes" value="Yes"></td>
<td><input type="radio" name="no" value="No"></td>
<td><input type="radio" name="na" value="N/A"></td>
</cfif>

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 ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

My idea is for you to read cf_dev2's answer again.

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
New Here ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

You're right, I didn't read icf_dev2's answer correctly. So I rewrote the code so each set had an individual name set, but it's still not working:

<td><input type="radio" name="cclselectfilter" value="Yes"></td>
<td><input type="radio" name="cclselectfilter" value="No"></td>
<td><input type="radio" name="cclselectfilter" value="N/A" checked></td>
<cfelse>
<td><input type="radio" name="cclselect" value="Yes"></td>
<td><input type="radio" name="cclselect" value="No"></td>
<td><input type="radio" name="cclselect" value="N/A"></td>
</cfif>

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
Guide ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

I think you misunderstood.

Each set of 3 buttons must have a different name

<input type="radio" name="cclselect1" value="Yes">
<input type="radio" name="cclselect1" value="No">
<input type="radio" name="cclselect1" value="N/A" checked>

<input type="radio" name="cclselect2" value="Yes">
<input type="radio" name="cclselect2" value="No">
<input type="radio" name="cclselect2" value="N/A" checked>

<input type="radio" name="cclselect3" value="Yes">
<input type="radio" name="cclselect3" value="No">
<input type="radio" name="cclselect3" value="N/A" checked>

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
New Here ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

Yes, I did misunderstand. I can't get my brain wrapped around why three sets when I only have two different criteria; however, it does work and I need to figure out the format. Thanks!

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
Guide ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

You don't need 3 sets specifically. That was an example of dynamically named sets of radio buttons.

Simply use a counter to dynamically name each set of radio buttons inside your output loop. You can use the "CurrentRow" variable.

<cfloop query="..." >
<cfoutput>
...

<td><input type="radio" name="cclselect#CurrentRow#" value="Yes"></td>
<td><input type="radio" name="cclselect#CurrentRow#" value="No"></td>
<td><input type="radio" name="cclselect#CurrentRow#" value="N/A"
<cfif ccdirect is cklstdirflg>checked></cfif>>
</td>
...
</cfoutput>
</cfloop>

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
New Here ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

LATEST
Thanks so much for your patience cf_dev2. It works great; I really appreciate your help!

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