Multiple checkboxes when checked only pass one variable in my list.

Posted on 2009-02-19
Last Modified: 2013-12-24
The INPUT checkbox only outputs one item even when multiple checkboxes are selected. Catalog_id is a number variable and for testing there are five catalog_id's available. Only the first catalog_id will be passed in the del_list output. Checking the other checkboxes has no effect; they are not passed by the form.

The cfoutput query is working. I inserted the #OrderInfo.catalog_id# so I can see the different catalog_id's next to the checkbox.

Look at my code and show me where I'm going wrong, why del_list output never shows more than one item.
<cfdump var="#form#">

<cfparam name="cid" default="852604">


<cfif IsDefined("Remove")>

  <cfif NOT IsDefined("del_list")>

    <H1>No items checked to remove.</H1>


  <cfif IsDefined("del_list")>

    <cfloop list="#del_list#" index="i">

      <cfquery name="dUpdate" datasource="cart">

       delete from orders

       where catalog_id = '#i#'       

       and cid = '#cid#'







<cfquery name="OrderInfo" datasource="cart">

  select catalog_id,cid

  from orders   

  where cid = '#cid#'

  order by id desc



<form name="form1" action="gunk.cfm" method="post">

<input type="submit" name="remove" value="Remove">


<cfoutput query="OrderInfo">

#OrderInfo.catalog_id#  <input type="checkbox" name="del_list" value="#catalog_id#">


  <input type="hidden" name="cid" value="#cid#" />



Open in new window

Question by:Janrow

    Accepted Solution

    Ah solved this myself. Got to placd the submit button below the cfoutput and end the form there.
    <input type="submit" name="remove" value="Remove">

    Open in new window

    LVL 27

    Expert Comment

    just fyi, where you place the submit button does not matter (as long as it is inside the <form> body) - you can move it back to the top of form if you want to.
    you problem was that you had the closing </form> tag inside the <cfoutput> = you form effectively ended after your first checkbox.


    Author Comment

    Exactly right! Thanks for the clarification.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now