Solved

input field with square brackets

Posted on 2011-09-07
2
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
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.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

635 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