You would give it an ID, that would correspond to the ID of the ValueID you
were looping on....
so

<cfoutput>
 <cfset current =
storeService.getCurrentOptions(prodID=#rc.ProdcutBean.getprodId()#,valueID=#rc.option.valueID#)>
<!--- <cfdump var="#current#">--->
 <tr>
   <td class="borderleft">&nbsp; <input id="checker#valueID#"
type="checkbox" <cfif current.idexists eq 1> checked="checked" </cfif>
/></td>
   <td>&nbsp;&nbsp;&nbsp;&nbsp;#rc.option.value#</td>
   <td>+ &pound; <input value="#NumberFormat(current.optionPrice,99.99)#"
type="text" name="optionPrice#valueID#" size="3" /> extra</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
 </tr>
 <input type="hidden" value="valueId" name="#rc.option.valueId#" />
 </cfoutput>

Then on the processing page, you need to loop over the form fields/list of
valueids and see what ones are checked

so, you can evaluate the form names dynamically with:

<cfif structkeyExists(form,'checker[currentrecord]')>

do whatever

</cfif>

HTH

Rob

On Fri, Sep 25, 2009 at 10:24 AM, Glyn Jackson
<glyn.jack...@newebia.co.uk>wrote:

>
> Going a bit mad! I should know how to do this but my brain is not working
> today....
>
> when the form below is submitted if the checkbox is checked I want to
> update the option on the valueId (which is a hidden field) and keep looping
> all the results only updating option have is ticked. however once submitted
> how will I know what checkbox ticked corresponded with what valueId?
>
>
> <cfoutput query="rc.option" group="name">
>  <tr class="tableBG2">
>    <td class="borderleft">&nbsp;</td>
>    <td><b>#rc.option.name#</b></td>
>    <td>&nbsp;</td>
>    <td>&nbsp;</td>
>    <td>&nbsp;</td>
>  </tr>
>
>  <cfoutput>
>  <cfset current =
> storeService.getCurrentOptions(prodID=#rc.ProdcutBean.getprodId()#,valueID=#rc.option.valueID#)>
> <!--- <cfdump var="#current#">--->
>  <tr>
>    <td class="borderleft">&nbsp; <input type="checkbox" <cfif
> current.idexists eq 1> checked="checked" </cfif> /></td>
>    <td>&nbsp;&nbsp;&nbsp;&nbsp;#rc.option.value#</td>
>    <td>+ &pound; <input value="#NumberFormat(current.optionPrice,99.99)#"
> type="text" name="optionPrice" size="3" /> extra</td>
>    <td>&nbsp;</td>
>    <td>&nbsp;</td>
>  </tr>
>  <input type="hidden" value="valueId" name="#rc.option.valueId#" />
>  </cfoutput>
>
>
> </cfoutput>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326631
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to