Tuesday, January 06, 2009    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Oct 2005 >>
S M T W T F S
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Search

Categories
 • Acrobat (2) [RSS]
 • Adobe (72) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (60) [RSS]
 • AdobeMAX09 (1) [RSS]
 • AIR (157) [RSS]
 • Appearances (142) [RSS]
 • Books (69) [RSS]
 • CFEclipse (14) [RSS]
 • ColdFusion (1196) [RSS]
 • Data Services (20) [RSS]
 • Fish Tank (2) [RSS]
 • Flash (114) [RSS]
 • Flex (394) [RSS]
 • Home Automation (3) [RSS]
 • Jobs (102) [RSS]
 • JRun (13) [RSS]
 • Labs (30) [RSS]
 • LiveCycle (23) [RSS]
 • MAX (192) [RSS]
 • Regular Expressions (15) [RSS]
 • RIA (14) [RSS]
 • SQL (38) [RSS]
 • Stuff (510) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (143) [RSS]
 • Wireless (101) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Day : October 3, 2005 / Main
October 3, 2005

How To Access Badly Named Form Fields

A user just e-mailed me with a problem. He had to process the results of an existing form which was made up of fields named with invalid characters (one was "first name"). Trying to access the field as #FORM.first name# won't work and will throw an error. So how to access these fields?

The answer is to remember that FORM is not just a prefix, it is also a structure. Structure members can be accessed as #structure.member# and as #structure["member"]#. And that latter format will allow access to badly named form fields (as the name is enclosed in quotes). So, the solution is to use #FORM["first name"]#.

TrackBacks
There are no trackbacks for this entry.

No trackback URL. Trackbacks are only allowed via interactive form.

Comments
Just as a heads up-- in my experience, some browsers post invalid form field names with spaces replaced with underscores.

For example, 'first name' might come through as 'first_name'.
# Posted By N Rohler | 10/3/05 7:17 PM
This same technique is useful for poorly name query columns, or columns that are dynamic. #query["column name"][currentRow]#
# Posted By Barney | 10/3/05 7:51 PM

  © Copyright 1997-2008 Ben Forta, All Rights Reserved