Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

input field with square brackets

Posted on 2011-09-07
2
Medium Priority
?
695 Views
Last Modified: 2012-05-12
In my form i have 1 elemnt with square bracket
   " <input name="bodyIDList[]"  id="bodyIDList" value="">"

when i pass this page to coldfusion how does this treat with form variable as a list or ana array
0
Comment
Question by:erikTsomik
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 1000 total points
ID: 36498106

That isn't a legal form field name... if you're trying to do an array-style form, just append a number to it..


  <input name="bodyIDList#counter#"  id="bodyIDList#counter#" value="">"

0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 1000 total points
ID: 36498852
>> when i pass this page to coldfusion how does this treat with form variable as a list or ana array

Neither.  CF treats it like any other form field. The value is a string.  But because it's not a valid variable name, you need to use array notation to access it.

     <cfset value = FORM["bodyIDList[]"]>



0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question