Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7830977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:30:28+00:00 2026-06-02T11:30:28+00:00

I’m doing a bit of CF development, and I was stuck on a problem

  • 0

I’m doing a bit of CF development, and I was stuck on a problem I had. Instead of banging my head on the keyboard I figured I would ask someone with a bit more experience.

So here’s what I’m dealing with:

<form name="inv" action="action.cfm" method="post" >

<cfoutput query="getQuery">

<input type="checkbox" name="ischecked" value="1" unchecked />
<input type="Hidden" name="DeviceID" value="#DeviceID#">
</td>

    <td><font size="3"><b>Device ID:</b></font>#DeviceID#</td>
    <td><font size="3"><b>User</b></font>#User#</td>
    <td><font size="3"><b>Tag:</b></font>#Tag#</td>
  </table>
  </cfoutput>
      <table>
          <tr><td> Action: </td>
           <td>

           <select name="choose_action">



            <option value="1"> Action 1 </option>

            <option value="2"> Action 2  </option>

            <option value="3"> Action 3  </option>


        </select>

<INPUT type="reset" name="reset" action="reset">

<INPUT type="submit" name="submit" action="submit">


        </td>
        </tr>

So basically I have this form where it outputs all the information from my query (which is working fine) and loops through and displays it. I want the user to be able to look at this information, click a checkbox of the specific device, and perform an action based on the menu at the bottom, which will then go to the action page and use the information passed in to perform queries based on cfif loops.

The problem I’m having is that I can’t figure out how to pass in the information I want that the user specifically checked, because it’s a loop. When I submit the hidden field containing the Device ID, I end up submitting every Device ID that has the checkbox (which is every one). Same goes for the checkbox values. It just dumps all the query data into the action page for each device in the query instead of just the one Device ID I wanted that was checked in the first place.

I was thinking some backend JS, but I wasn’t entirely sure about how I would go about doing that.
I was hoping I could validate it and say, before submission: “well if this is checked, then only submit this specific Device ID”

Thanks for your time and feedback! Let me know if I need to clarify anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:30:33+00:00Added an answer on June 2, 2026 at 11:30 am

    Here’s 2 answers (and I’ve seen both).

    First – try making the device ID part of the “name” of your checkbox.

    <cfoutput query="getQuery">
    
    <input type="checkbox" name="ischecked_#deviceID#" value="1" unchecked />
    
    </cfoutput>
    

    Then you would loop through form like so:

    <cfloop collection="#form#" item="fItem">
       <cfif listfirst(fItem,'_') IS 'ischecked'>
          <cfset thisDeviceID = listlast(fItem,'_')>
           ...do something with deviceID
       </cfif>
    </cfloop>
    

    The second approach would be to store the device ID In the “ischecked” form field like so:

    <cfoutput query="getQuery">
    
    <input type="checkbox" name="ischecked" value="#deviceID#" unchecked />
    
    </cfoutput>
    

    The values come through as a list containing anything checked… so if your user checks 1, 5, and 7 the variagble #form.isChecked# will be a list that looks like 1,5,7. Using listfind or cfloop or whatever to do something with it. Just remember you’ll have to use check to make sure taht form.isChecked exists because if nothing is checked it will not exist (for most browsers).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm parsing an XML file, the creators of it stuck in a bunch social
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.