I have a form that asks the user for a quantity. This quantity is used to check the checkboxes on the action page. Here is code example for the action page:

<cfparam name="Form.quantity" default="">
<cfif Form.quantity GT '0'>
<cfset client.quantity_token = 'Y'>
<cfelse>
<cfset client.quantity_token = 'N'>
</cfif>

<cfoutput query="search">				
<cfif client.quantity_token EQ 'Y'>				
<cfif Form.quantity GTE #search.Recordcount#>			
<cfif #search.phone# EQ ''>					
<INPUT TYPE="checkbox" value="#search.id#" name="id" checked>
<cfelse>
<INPUT TYPE="checkbox" value="#search.phone#" name="phone" checked>	
</cfif>
<cfelse>
<cfif #search.phone# EQ ''>
<INPUT TYPE="checkbox" value="#search.id#" name="id">
<cfelse>
<INPUT TYPE="checkbox" value="#search.phone#" name="phone">	
</cfif>							
</cfif>							
<cfelse>	
<cfif #search.phone# EQ ''>
<INPUT TYPE="checkbox" value="#search.id#" name="id">
<cfelse>
<INPUT TYPE="checkbox" value="#search.phone#" name="phone">	
</cfif>
</cfif>
<a href="editdata.cfm?id=#search.id#&phone=#search.phone#" target="MainFrame">#id#</a>
#name#
#phone#
#house_number# #street_name#
#city#
#STATE#
#ZIP#-#ZIP4#</cfoutput>
</cfoutput>

The code above is checking all the checkboxes if the quantity requested is greater than or equal to the record count of the query. Which is good. But Im stuck on the the 2nd part, taking the quantity requested say 100 but still displaying 200 with 100 of the 200 checkboxes checked. Any help would be awesome. Thanks.

I have added a uuid field for less confusion on my part

<cfif client.quantity_token EQ 'Y'>
<cfif Form.quantity GTE #search.Recordcount#>
<INPUT TYPE="checkbox" value="#search.uuid#" name="uuid" checked>	
<cfelse>							
<INPUT TYPE="checkbox" value="#search.uuid#" name="uuid">		
</cfif>
<cfelse>
<INPUT TYPE="checkbox" value="#search.uuid#" name="uuid">	
</cfif>

I went ahead and found a work around by adding maxRows = "Form.quantity"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.