Advertisement

07.01.2008 at 11:13AM PDT, ID: 23531143
[x]
Attachment Details

How can I clear a column of checkboxes that are created dynamically?

Asked by brihol44 in Web Development, Web Languages/Standards, Cold Fusion Markup Language

Tags: Coldfusion clear checkboxes dynamically

Hello, I have three columns of checkboxes and I'm hoping to have a "Clear All" feature so I can clear all the checkboxes. However I have three columns of checkboxes and the checkboxes are created dynamically as well as numbered with different names to input the correct record for them.

BStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
<cfset counter = 0>
 
<form name="myForm" action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" method="post">
<table border="0" cellspacing="0" cellpadding="3">
  <tr>
    <td width="351">Company Name</td>
    <td width="61" nowrap="nowrap"><div align="center">Print Ad</div></td>
    <td width="88" nowrap="nowrap"><div align="center">Web Banner</div></td>
    <td width="81" nowrap="nowrap"><div align="center">Newsletter</div></td>
    <td width="81" nowrap="nowrap"> <div align="center">Profile</div></td>
    <td width="81" nowrap="nowrap"><div align="center">Notes</div></td>
  </tr>
  <cfoutput query="get_advertisers">
  
  <cfquery name="get_checked_boxes" datasource="#dns#">
  	SELECT * 
    FROM advertisers_ad_list
    WHERE advertiser_id = '#get_advertisers.advertiser_id#'
  </cfquery>
  <cfset counter = IncrementValue(counter)>
      <tr bgcolor="###iif(currentrow MOD 2,DE('ffffff'),DE('efefef'))#">
        <td><input name="advertiser_id#counter#" type="hidden" value="#get_advertisers.advertiser_id#" />#get_advertisers.company_name#</td>
        <td><div align="center">
          <input name="pa#counter#" type="checkbox" value="1" <cfif isdefined("get_checked_boxes.print_advertising") AND get_checked_boxes.print_advertising EQ "1">checked<cfelse></cfif>/>
        </div></td>
        <td><div align="center">
          <input name="wb#counter#" type="checkbox" value="1" <cfif isdefined("get_checked_boxes.web_advertising") AND get_checked_boxes.web_advertising EQ "1">checked<cfelse></cfif> />
        </div></td>
        <td><div align="center">
          <input name="nl#counter#" type="checkbox" value="1" <cfif isdefined("get_checked_boxes.newsletter_advertising") AND get_checked_boxes.newsletter_advertising EQ "1">checked<cfelse></cfif>/>
        </div></td>
        <td><div align="center">Profile</div></td>
        <td> <div align="center">Note</div></td>
      </tr>
  </cfoutput>
</table>
<br />
<input name="submit" type="submit" value="submit"/>
<input type="hidden" name="counter" value="<cfoutput>#counter#</cfoutput>">
</form>
[+][-]07.01.2008 at 11:41AM PDT, ID: 21910354

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 07:03PM PDT, ID: 21912928

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Web Development, Web Languages/Standards, Cold Fusion Markup Language
Tags: Coldfusion clear checkboxes dynamically
Sign Up Now!
Solution Provided By: scrathcyboy
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628