> listed in form text boxes. If I want to edit one, I can change
> the content
> of that text box and then hit the submit button and it edits the database.
> The problem I'm running into is that I can't name the form fields the same
> thing because then it won't know which to edit... Can anybody
> explain how I
> would do this? I am very new to coldfusion. Thank you for the help.
You could add the ProductIDs into the field names:
<input type="text" name="DSC_#ProductID#" value="#GetProducts.Description#">
<input type="text" name="PRC_#ProductID#" value="#GetProducts.Price#">
Then to action it, loop over the entire FORM structure looking for "DSC_..."
etc:
<cfloop collection="#Form#" item="FieldName">
<cfset FieldType=Left(FieldName,4)>
<cfif Len(FieldName) GT 4>
<cfset ProductID=Mid(FieldName,5,Len(FieldName) - 4)>
<cfswitch expression="#FieldType#">
<cfcase value="DSC_">
Do something
</cfcase>
</cfswitch>
</cfif>
</cfloop>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.