Thanks for the quick response. Tried that and no luck.
Athelene
-----Original Message-----
From: David E. Crawford [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 08, 2000 12:10 PM
To: [EMAIL PROTECTED]
Subject: Re: Multiple value Select
This is a multi-part message in MIME format.
------=_NextPart_000_0242_01C0015B.7347C930
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
RE: Multiple value SelectSee if changing:
ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)
to
ListContains(GetPG.PG,EditNameQry.PracticeGroup)
Makes a difference. The # signs are not required inside CF functions.
DC
----- Original Message -----=20
From: Gieseman, Athelene=20
To: '[EMAIL PROTECTED]'=20
Sent: Tuesday, August 08, 2000 17:03
Subject: RE: Multiple value Select
OK. I have another application where I do in fact use a table for the =
lookup. I've tried to use your example and apply it here. But =
nothing is=20
selected. My code is as follows:=20
<cfquery datasource=3D"FirmDirectory" name=3D"EditNameQry">=20
Select * from Employees where ID=3D'#EditGrid.ID#'=20
</cfquery>=20
<cfquery datasource=3D"FirmDirectory" name=3D"GetPG">=20
Select * from PracticeGroups order by PG=20
</cfquery>=20
<cfselect name=3D"NewPG" size=3D"3" multiple>=20
<CFLoop query=3D"GetPG">=20
<CFIF=20
ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)>=20
<CFSET PGSelected =3D "Selected">=20
<CFELSE>=20
<CFSET PGSelected =3D "">=20
</cfif>=20
<Option #PGSelected#=20
value=3D"#PG#"><cfoutput>#PG#</cfoutput></option>=20
</cfloop>=20
</cfselect>=20
Note that if I replace the : <CFIF=20
ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)>=20
with: <CFIF ListContains(GetPG.PG,"Agribusiness")>=20
Then Agribusiness is in fact selected. So I'm assuming there's =
something=20
wrong with that one line. Do you happen to see where I went wrong?=20
TIA,=20
Athelene=20
-----Original Message-----=20
From: Mark Armendariz [mailto:[EMAIL PROTECTED]]=20
Sent: Tuesday, August 08, 2000 7:44 AM=20
To: [EMAIL PROTECTED]=20
Subject: RE: Multiple value Select=20
I did this sort of thing for an intranet i'm working on with selected=20
company newsgroups... The best way to do it is with a database of your =
finance types. This will allow you to updae the select statement =
without=20
changing the hard coding. So the form will always be right. Query =
that=20
database and the user database. In the user database, you will want =
to save=20
a comma delimited list of the finance types they are assigned for. =
When you=20
bring up the select, you can scroll through all the finance types, and =
if=20
the user had any in his/her list, they will set the FinanceSelected =
variable=20
to 'selected.' if they're not in the list, FinanceSelected will be =
blank.=20
Hope this helps...=20
<CFQuery Name=3D"GetFinances" datasource=3D"#Application.datasource#"> =
SELECT FinanceName=20
FROM tblFinances=20
ORDER By FinanceName=20
</CFQuery>=20
<CFQuery Name=3D"GetCustomer" datasource=3D"#Application.datasource#"> =
SELECT CustomerName,=20
Address,=20
Finances <!--- This Field is a comma delimited =
list=20
of the user's=20
finances --->=20
FROM tblCustomers=20
WHERE CustomerID =3D #Attributes.CustomerID#=20
</cfgquery>=20
Finances:<br>=20
<Select Name=3D"Finances" size=3D"#GetFinances.RecordCount#" multiple> =
<CFLoop query=3D"Finances">=20
<CFIF ListContains(GetCustomer.Finances,#FinanceName#)>=20
<CFSET FinanceSelected =3D "Selected">=20
<CFELSE>=20
<CFSET FinanceSelected =3D "">=20
</cfif>=20
<Option #FiannceSelected# =
value=3D"#FinanceName#">#FinanceName#</option>=20
</cfloop>=20
</select>=20
Mark Armendariz=20
Righteous Design=20
www.sorighteous.com=20
[EMAIL PROTECTED]=20
-----Original Message-----=20
From: Gieseman, Athelene [mailto:[EMAIL PROTECTED]]=20
Sent: Monday, August 07, 2000 6:34 PM=20
To: [EMAIL PROTECTED]=20
Subject: Multiple value Select=20
I'm trying to set up a CFSELECT using the SELECTED option. I need to =
have=20
the CFSELECT set up as multiple since more than one option is =
permitted.=20
However, I can never seem to get the SELECTED option to properly =
highlight=20
the options that are already stored in the record. (In other words, I =
want=20
to create an edit screen where the previously stored values are =
preselected=20
in this control.) Any thoughts on what I may be doing wrong? The =
code for=20
my select follows: (Note that ViewGrid is a grid from which the user=20
previously selected this record. I've also tried doing this from a =
query=20
with the same result - nothing is selected.)=20
<cfselect name=3D"FinanceType" size=3D"2" =
selected=3D"#ViewGrid.FinanceType#"=20
multiple>=20
<option value=3D"Single Family Housing">Single Family Housing</option> =
<option value=3D"501(c)(3)">501(c)(3)</option>=20
<option value=3D"Hospital Revenue">Hospital Revenue</option>=20
<option value=3D"Leasehold Revenue">Leasehold Revenue</option>=20
<option value=3D"Multifamily Housing">Multifamily Housing</option>=20
<option value=3D"General Obligation">General Obligation</option>=20
<option value=3D"NID">NID</option>=20
<option value=3D"Special Obligation">Special Obligation</option>=20
<option value=3D"Industrial Development">Industrial =
Development</option>=20
<option value=3D"TIF">TIF</option>=20
<option value=3D"TDD/TC">TDD/TC</option>=20
<option value=3D"Other">Other</option>=20
</cfselect>=20
=
-------------------------------------------------------------------------=
---=20
--=20
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/=20
To Unsubscribe visit=20
=
http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dlists/cf_ta=
lk or=20
send a message to [EMAIL PROTECTED] with 'unsubscribe' =
in=20
the body.=20
=
-------------------------------------------------------------------------=
---=20
--=20
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/=20
To Unsubscribe visit=20
=
http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dlists/cf_ta=
lk or=20
send a message to [EMAIL PROTECTED] with 'unsubscribe' =
in=20
the body.=20
=
-------------------------------------------------------------------------=
-----=20
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/=20
To Unsubscribe visit =
http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dlists/cf_ta=
lk or send a message to [EMAIL PROTECTED] with =
'unsubscribe' in the body.
------=_NextPart_000_0242_01C0015B.7347C930
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: Multiple value Select</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>See if changing:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT=20
size=3D2>ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)</FONT></FONT>=
</DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT=20
size=3D2>ListContains(GetPG.PG,EditNameQry.PracticeGroup)</FONT></FONT></=
DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Makes a difference. The # signs =
are not=20
required inside CF functions.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>DC</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A href=3D"mailto:[EMAIL PROTECTED]" =
[EMAIL PROTECTED]>Gieseman,=20
Athelene</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
href=3D"mailto:'[EMAIL PROTECTED]'"=20
[EMAIL PROTECTED]>'[EMAIL PROTECTED]'</A> =
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, August 08, 2000=20
17:03</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: Multiple value =
Select</DIV>
<DIV><BR></DIV>
<P><FONT size=3D2>OK. I have another application where I do in =
fact use a=20
table for the</FONT> <BR><FONT size=3D2>lookup. I've tried to =
use your=20
example and apply it here. But nothing is</FONT> <BR><FONT=20
size=3D2>selected. My code is as follows:</FONT> </P>
<P><FONT size=3D2><cfquery datasource=3D"FirmDirectory"=20
name=3D"EditNameQry"></FONT> <BR><FONT size=3D2>Select * from =
Employees where=20
ID=3D'#EditGrid.ID#'</FONT> <BR><FONT size=3D2></cfquery></FONT> =
</P>
<P><FONT size=3D2><cfquery datasource=3D"FirmDirectory" =
name=3D"GetPG"></FONT>=20
<BR><FONT size=3D2>Select * from PracticeGroups order by PG</FONT> =
<BR><FONT=20
size=3D2></cfquery></FONT> </P>
<P><FONT size=3D2> <cfselect=20
name=3D"NewPG" size=3D"3" multiple></FONT>=20
<BR> =20
=20
<FONT size=3D2><CFLoop=20
query=3D"GetPG"></FONT> =
<BR> =20
=20
<FONT =
size=3D2><CFIF</FONT>=20
<BR><FONT =
size=3D2>ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)></FONT>=20
<BR> =20
=20
<FONT size=3D2><CFSET =
PGSelected =3D=20
"Selected"></FONT> <BR> =20
=20
<FONT =
size=3D2><CFELSE></FONT>=20
<BR><FONT size=3D2> =20
<CFSET PGSelected =3D=20
""></FONT> <BR> =20
=20
<FONT =
size=3D2></cfif></FONT>=20
<BR> =20
=20
<FONT size=3D2><Option=20
#PGSelected#</FONT> <BR><FONT=20
=
size=3D2>value=3D"#PG#"><cfoutput>#PG#</cfoutput></opti=
on></FONT>=20
<BR> =20
=20
<FONT =
size=3D2></cfloop></FONT>=20
<BR> =20
<FONT=20
size=3D2></cfselect></FONT> </P>
<P><FONT size=3D2>Note that if I replace the : <CFIF</FONT> =
<BR><FONT=20
size=3D2>ListContains(GetPG.PG,#EditNameQry.PracticeGroup#)></FONT> =
<BR><FONT=20
size=3D2>with: <CFIF =
ListContains(GetPG.PG,"Agribusiness")></FONT>=20
</P>
<P><FONT size=3D2>Then Agribusiness is in fact selected. So I'm =
assuming=20
there's something</FONT> <BR><FONT size=3D2>wrong with that one =
line. Do=20
you happen to see where I went wrong? </FONT></P>
<P><FONT size=3D2>TIA,</FONT> </P>
<P><FONT size=3D2>Athelene </FONT></P>
<P><FONT size=3D2>-----Original Message-----</FONT> <BR><FONT =
size=3D2>From: Mark=20
Armendariz [<A=20
=
href=3D"mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</FO=
NT>=20
<BR><FONT size=3D2>Sent: Tuesday, August 08, 2000 7:44 AM</FONT> =
<BR><FONT=20
size=3D2>To: [EMAIL PROTECTED]</FONT> <BR><FONT =
size=3D2>Subject: RE:=20
Multiple value Select</FONT> </P><BR>
<P><FONT size=3D2>I did this sort of thing for an intranet i'm working =
on with=20
selected</FONT> <BR><FONT size=3D2>company newsgroups... The best way =
to do it=20
is with a database of your</FONT> <BR><FONT size=3D2>finance =
types. This=20
will allow you to updae the select statement without</FONT> <BR><FONT=20
size=3D2>changing the hard coding. So the form will always be =
right. =20
Query that</FONT> <BR><FONT size=3D2>database and the user =
database. In=20
the user database, you will want to save</FONT> <BR><FONT size=3D2>a =
comma=20
delimited list of the finance types they are assigned for. When=20
you</FONT> <BR><FONT size=3D2>bring up the select, you can scroll =
through all=20
the finance types, and if</FONT> <BR><FONT size=3D2>the user had any =
in his/her=20
list, they will set the FinanceSelected variable</FONT> <BR><FONT =
size=3D2>to=20
'selected.' if they're not in the list, FinanceSelected will be=20
blank.</FONT> </P>
<P><FONT size=3D2>Hope this helps...</FONT> </P>
<P><FONT size=3D2><CFQuery Name=3D"GetFinances"=20
datasource=3D"#Application.datasource#"></FONT> <BR><FONT =
size=3D2> =20
SELECT FinanceName</FONT> =
<BR><FONT=20
size=3D2> FROM tblFinances</FONT> <BR><FONT =
size=3D2> ORDER=20
By FinanceName</FONT> <BR><FONT=20
size=3D2></CFQuery></FONT> </P>
<P><FONT size=3D2><CFQuery Name=3D"GetCustomer"=20
datasource=3D"#Application.datasource#"></FONT> <BR><FONT =
size=3D2> =20
SELECT CustomerName,</FONT>=20
<BR> =20
<FONT =
size=3D2>Address,</FONT>=20
<BR> =20
<FONT=20
size=3D2>Finances <!--- =
This Field=20
is a comma delimited list</FONT> <BR><FONT size=3D2>of the =
user's</FONT>=20
<BR><FONT size=3D2>finances ---></FONT> <BR><FONT size=3D2> =
FROM =20
tblCustomers</FONT> <BR><FONT size=3D2> WHERE CustomerID =3D=20
#Attributes.CustomerID#</FONT> <BR><FONT =
size=3D2></cfgquery></FONT>=20
</P><BR>
<P><FONT size=3D2>Finances:<br></FONT> </P>
<P><FONT size=3D2><Select Name=3D"Finances" =
size=3D"#GetFinances.RecordCount#"=20
multiple></FONT> <BR><FONT size=3D2> <CFLoop=20
query=3D"Finances"></FONT> <BR><FONT size=3D2> =
<CFIF=20
ListContains(GetCustomer.Finances,#FinanceName#)></FONT> <BR><FONT=20
size=3D2> <CFSET FinanceSelected =3D=20
"Selected"></FONT> <BR><FONT size=3D2> =20
<CFELSE></FONT> <BR><FONT =
size=3D2> =20
<CFSET FinanceSelected =3D ""></FONT> <BR><FONT =
size=3D2> =20
</cfif></FONT> <BR><FONT size=3D2> <Option=20
#FiannceSelected# =
value=3D"#FinanceName#">#FinanceName#</option></FONT>=20
<BR><FONT size=3D2> </cfloop></FONT> <BR><FONT=20
size=3D2></select></FONT> </P><BR><BR>
<P><FONT size=3D2>Mark Armendariz</FONT> <BR><FONT size=3D2>Righteous=20
Design</FONT> <BR><FONT size=3D2>www.sorighteous.com</FONT> <BR><FONT=20
size=3D2>[EMAIL PROTECTED]</FONT> </P><BR>
<P><FONT size=3D2>-----Original Message-----</FONT> <BR><FONT =
size=3D2>From:=20
Gieseman, Athelene [<A=20
=
href=3D"mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>]</=
FONT>=20
<BR><FONT size=3D2>Sent: Monday, August 07, 2000 6:34 PM</FONT> =
<BR><FONT=20
size=3D2>To: [EMAIL PROTECTED]</FONT> <BR><FONT =
size=3D2>Subject: Multiple=20
value Select</FONT> </P><BR>
<P><FONT size=3D2>I'm trying to set up a CFSELECT using the SELECTED=20
option. I need to have</FONT> <BR><FONT size=3D2>the CFSELECT =
set up as=20
multiple since more than one option is permitted.</FONT> <BR><FONT=20
size=3D2>However, I can never seem to get the SELECTED option to =
properly=20
highlight</FONT> <BR><FONT size=3D2>the options that are already =
stored in the=20
record. (In other words, I want</FONT> <BR><FONT size=3D2>to =
create an=20
edit screen where the previously stored values are preselected</FONT>=20
<BR><FONT size=3D2>in this control.) Any thoughts on what I may =
be doing=20
wrong? The code for</FONT> <BR><FONT size=3D2>my select =
follows: =20
(Note that ViewGrid is a grid from which the user</FONT> <BR><FONT=20
size=3D2>previously selected this record. I've also tried doing =
this from=20
a query</FONT> <BR><FONT size=3D2>with the same result - nothing is=20
selected.)</FONT> </P>
<P><FONT size=3D2><cfselect name=3D"FinanceType" size=3D"2"=20
selected=3D"#ViewGrid.FinanceType#"</FONT> <BR><FONT =
size=3D2>multiple></FONT>=20
<BR><FONT size=3D2><option value=3D"Single Family =
Housing">Single Family=20
Housing</option></FONT> <BR><FONT size=3D2><option=20
value=3D"501(c)(3)">501(c)(3)</option></FONT> <BR><FONT=20
size=3D2><option value=3D"Hospital Revenue">Hospital=20
Revenue</option></FONT> <BR><FONT size=3D2><option =
value=3D"Leasehold=20
Revenue">Leasehold Revenue</option></FONT> <BR><FONT=20
size=3D2><option value=3D"Multifamily Housing">Multifamily=20
Housing</option></FONT> <BR><FONT size=3D2><option =
value=3D"General=20
Obligation">General Obligation</option></FONT> <BR><FONT=20
size=3D2><option value=3D"NID">NID</option></FONT> =
<BR><FONT=20
size=3D2><option value=3D"Special Obligation">Special=20
Obligation</option></FONT> <BR><FONT size=3D2><option =
value=3D"Industrial=20
Development">Industrial Development</option></FONT> <BR><FONT =
size=3D2><option value=3D"TIF">TIF</option></FONT> =
<BR><FONT=20
size=3D2><option value=3D"TDD/TC">TDD/TC</option></FONT> =
<BR><FONT=20
size=3D2><option value=3D"Other">Other</option></FONT> =
<BR><FONT=20
size=3D2></cfselect></FONT> <BR><FONT=20
=
size=3D2>----------------------------------------------------------------=
------------</FONT>=20
<BR><FONT size=3D2>--</FONT> <BR><FONT size=3D2>Archives: <A=20
href=3D"http://www.mail-archive.com/cf-talk@houseoffusion.com/"=20
=
target=3D_blank>http://www.mail-archive.com/cf-talk@houseoffusion.com/</A=
></FONT>=20
<BR><FONT size=3D2>To Unsubscribe visit</FONT> <BR><FONT size=3D2><A=20
=
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3D=
lists/cf_talk"=20
=
target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
p;body=3Dlists/cf_talk</A>=20
or</FONT> <BR><FONT size=3D2>send a message to =
[EMAIL PROTECTED]=20
with 'unsubscribe' in</FONT> <BR><FONT size=3D2>the body.</FONT> </P>
<P><FONT=20
=
size=3D2>----------------------------------------------------------------=
------------</FONT>=20
<BR><FONT size=3D2>--</FONT> <BR><FONT size=3D2>Archives: <A=20
href=3D"http://www.mail-archive.com/cf-talk@houseoffusion.com/"=20
=
target=3D_blank>http://www.mail-archive.com/cf-talk@houseoffusion.com/</A=
></FONT>=20
<BR><FONT size=3D2>To Unsubscribe visit</FONT> <BR><FONT size=3D2><A=20
=
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3D=
lists/cf_talk"=20
=
target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
p;body=3Dlists/cf_talk</A>=20
or</FONT> <BR><FONT size=3D2>send a message to =
[EMAIL PROTECTED]=20
with 'unsubscribe' in</FONT> <BR><FONT size=3D2>the body.</FONT> =
<BR><FONT=20
=
size=3D2>----------------------------------------------------------------=
--------------</FONT>=20
<BR><FONT size=3D2>Archives: <A=20
href=3D"http://www.mail-archive.com/cf-talk@houseoffusion.com/"=20
=
target=3D_blank>http://www.mail-archive.com/cf-talk@houseoffusion.com/</A=
></FONT>=20
<BR><FONT size=3D2>To Unsubscribe visit <A=20
=
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3D=
lists/cf_talk"=20
=
target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
p;body=3Dlists/cf_talk</A>=20
or send a message to [EMAIL PROTECTED] with =
'unsubscribe' in=20
the body.</FONT></P></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0242_01C0015B.7347C930--
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.