Solved

input field with square brackets

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Coldfusion scheduled tasks as one task 2 66
Code Igniter question... 3 67
CSS Question.. 3 72
replace quotes with UTF-8 character 38 68
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now