Hi Wey,

<!---Using brute forceYou can do a:--->

<cfoutput>

<cfset selState = "'AL,AK,AS,AZ,AR,CA,CO,CT,DC,DE,FL,GA'">

original selState: #selState#<br><br>

<cfset newStateList =  #REReplace(selState, ",", "','", "ALL")#>

selState with more commas: #newStateList#<br><br>

</cfoutput>

Make sure to modify this in case a single selection needs a different action
taken than a multiple selection. 


Hope this helps,

/LEMAN/
[EMAIL PROTECTED]

-----Original Message-----
From: Wey Hueymeei [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 27, 2000 3:57 PM
To: [EMAIL PROTECTED]
Subject: Add single quotes to each element on a list

Hello,

I have a multiple selection list of states in the US
<cfselect display="rstate_name"
    multiple="yes"
    size="5"
    required="yes"
    message="Please select a state!"
    value="rstate_code"
    query="selByState"
    name="selState">
 </cfselect>

When the user selects several out of the list and submit, the selected state
Code are passed as
selState = 'AL,AK,AS,AZ,AR,CA,CO,CT,DC,DE,FL,GA'

I wonder if there is a way to make the list like
selState = 'AL','AK','AS','AZ','AR','CA','CO','CT','DC','DE','FL','GA'

because on the next page i am writing some SQL like this
   SELECT *
   FROM ORIA_STAKEHOLDER
   WHERE RSTATE_CODE IN (#selState#)

I should have single quotes on each of the elements so I could get correct
result.

Any input is appreciated, HTH

Sylvia

----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
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.eGroups.com/list/cf-talk
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.

Reply via email to