tracker issue : CF-3037104

select a category, or use search below
(searches all categories and all time range)
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 Tracker

Status/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:

Brian is right on with this request. If you want help integrating this with jQuery or other AJAX libraries this is something that we seem to have down at this time. Could save time... but this is a big win feature in our opinion. It makes form variable handling more round trip friendly rather than wasting developer time and mental energy. This is a pragmatic solution and works great.
Vote by External U.
24367 | November 10, 2011 07:09:29 PM GMT
This bug has been voted..
Vote by External U.
24368 | November 10, 2011 07:09:30 PM GMT
This bug has been voted..
Vote by External U.
24369 | November 10, 2011 07:09:33 PM GMT
This bug has been voted..
Vote by External U.
24370 | November 10, 2011 07:09:34 PM GMT
This bug has been voted..
Vote by External U.
24371 | November 10, 2011 07:09:36 PM GMT
This bug has been voted..
Vote by External U.
24372 | November 10, 2011 07:09:37 PM GMT
This bug has been voted..
Vote by External U.
24373 | November 10, 2011 07:09:38 PM GMT
Agreed. This should be built into CF
Vote by External U.
24374 | November 10, 2011 07:09:39 PM GMT
This bug has been voted..
Vote by External U.
24375 | November 10, 2011 07:09:40 PM GMT
This bug has been voted..
Vote by External U.
24376 | November 10, 2011 07:09:42 PM GMT
This bug has been voted..
Vote by External U.
24377 | November 10, 2011 07:09:44 PM GMT
Folks, this isn't a duplicate. This is asking for much more than just creating a 1 dimensional array.
Comment by External U.
24366 | June 19, 2012 09:07:45 AM GMT