0

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.

1
Contributor
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Prodian
0

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>
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.