Title:
Bug 74515:Many people using CF encounter one common issue: they have to jump through hoops to handle forms that have a number of duplicated fields (username_1, username_2, etc
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Brian Kotek / Brian kotek (brian428)
Created: 12/18/2008
Components: CFForm, Standard XML
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 11
Duplicate ID: CF-3041386
Problem:
Many people using CF encounter one common issue: they have to jump through hoops to handle forms that have a number of duplicated fields (username_1, username_2, etc.) and parse this into something manageable on the server.
PHP offers something basic by converting duplicated fields into an array, and I know we can get at an array of parameters using the underlying Java page context, but I think we can go much further and make this much easier.
A while back I attempted to deal with this by releasing a Form Utilities CFC at RIAForge (http://formutils.riaforge.org/). In essence, when you run the form scope through this CFC, it converts arbitrary structure and array syntax into actual structures an arrays on the ColdFusion side. So form field names like:
form.user[1].id
form.user[2].id
Will get converted into an array named "user" with 2 elements, and each element is a struct with the key "id". The RIAForge page and my blog entry at http://www.briankotek.com/blog/index.cfm/2007/9/4/Implicit-Creation-of-Arrays-and-Structures-from-Form-Fields go into much more detail. But I've found this to be incredibly helpful when dealing with non-trivial forms.
I don't know if this should be a server setting, a per-application setting, or a function that simply does the translation, but I think this could help with a fairly complex problem that MANY people run into. And I'm almost positive that a native Java solution built into the language/server would be much faster than the CFC I created.
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3037104
External Customer Info:
External Company:
External Customer Name: Brian kotek
External Customer Email: 27EF5CB74460F39E99201549
External Test Config: 12/18/2008
Attachments:
Comments: