Solved

input field with square brackets

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

914 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now