Ask a Question related to Coldfusion Database Access, Design and Development.
-
sage703 #1
Multiple select of list boxes
I am allowing my users to select multiple items in a list box, and I've set
that up so it works swell. However, I'm unsure how to set each of the values
selected into a Coldfusion variable. Do I need to use arrays? If so, how would
I go about doing this with multiple selections from a listbox?
FYI: Here's what my listbox looks like currently:
<cfselect query="location" multiple="yes" size="5"
name="Location" value="Location" selected="#SESSION.ProgWiz.Location#"/>
Thanks,
S./:confused;:|
sage703 Guest
-
Dynamically Populate Multiple Select Boxes
I am trying to develop an application where a user selects the Year, Make and Model of their vehicle. In the past, I had a query that input the... -
Select a list of items into an aliased field when doinga select
OK I know this is going to sound weird, but I'm wondering if this is possible. I have a task table. (tblTask) These tasks can be assigned to... -
multiple select list default values (asp/vb)
(asp/vb) Hi all, I have a multiple select list on an insert record form. I can make multiple selections and insert them into the database... -
#25474 [Bgs]: posting arrays from a select box with multiple select is not working properly
ID: 25474 User updated by: fmuller at cisco dot com -Summary: apache2filter: posting from a multiple select box is not... -
List Box Multiple Select Problem
I am trying to create a drop down list that permits a person to select multiple items from the list and have the results posted on a results page. I... -
MikerRoo #2
Re: Multiple select of list boxes
You don't need arrays.
CFSelect returns multiple values as a comma-seperated list.
So the form's action page would see the variable FORM.Location and if multiple
values were selected, FORM.Location's value might look like
"Apple,Banana,Cherry".
You could use <CFLOOP index="Fruit" List="#FORM.Location#"> to get at and
process the selections.
-- MikeR
MikerRoo Guest
-
sage703 #3
Re: Multiple select of list boxes
Ok, so in another segment of code (let's say on the session processing page), I
could insert each of the values in the list into my table as separate records
using code such as this:
<cfif IsDefined("#SESSION.ProgWiz.Location#">
<cfloop index=i loc_list="#SESSION.ProgWiz.Location#">
<cfset index(i) = loc_list>
</cfif>
INSERT INTO <tablename>(
<fieldname1>
<fieldname2>
etc...
VALUES (
<cfif index>
index(i)
</cfif>
<fieldname2>
etc....)
That seems sort of right, but not quite (for example, i'll need to loop the
index value in the INSERT statement so I can make multiple entries at once. Do
you have any more useful tips Mike?
S./
sage703 Guest



Reply With Quote

