<CFIF NOT Compare(Right(FORM.Location, 1), ";")>
<CFSET FORM.Location = RemoveChars(FORM.Location, Len(FORM.Location), 1)>
</CFIF>
<CFSET city_list = ListAppend(city_list, ListGetAt(FORM.Location, 1))>
<CFSET state_list = ListAppend(state_list, ListGetAt(FORM.Location, 2))>
<CFSET country_list = ListAppend(country_list, ListGetAt(FORM.Location, 3))>
Steve
-----Original Message-----
From: Warrick, Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 18, 2000 9:49 PM
To: CF-Talk
Subject: String Confusion
Not sure where my brain is at (probably still thinking about that spammer)
but I'm having trouble picking apart a string.
On a form, I have this form field:
<select name="location">
<option value="#city#,#state#,#country#;">#country# - #state# - #city#
</select>
I need to perform a search based upon the city, state, and country so that's
why I need all three of those variables passed through at the same time.
And I don't want the users to have to select all three options because that
would not be user friendly.
So I need to create 3 lists based upon the data that gets passed through.
The lists will be used in the SQL query. The lists will be called:
state_list
city_list
country_list
I know I need to loop through each of the location records passed through
the form, but how can I split apart the 3 fields: city, state, country?
---mark
--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=sts or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]