Solved

input field with square brackets

Posted on 2011-09-07
2
659 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 250 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 250 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create associate webpages / websites 3 91
Select distinct 25 116
Animated .jpg? 13 97
Restore of mysql database from .SQL file - using Coldfusion 5 41
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 …
There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

821 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