aimee,
do an isDefined first....that way, if it is defined, you can check for
its value, however it
seems as though it's a null value, therefore, its bombing cause there is
nothing to compare
1 to....like this....
<cfif IsDefined("GetOld.FLanaguage") and GetOld.FLanaguage IS "">
<cfset chgFLanguage = "">
<cfelseif IsDefined("GetOld.FLanaguage") and GetOld.FLanguage IS NOT
'#FLanguage#'>
<cfset chgFLanguage = #FLanguage#>
</cfif>
try that.
..tony
Tony Weeg
Senior Web Developer
Information System Design
Navtrak, Inc.
Fleet Management Solutions
www.navtrak.net
410.548.2337
-----Original Message-----
From: Clark, Aimee [mailto:aclark@;stinsonmoheck.com]
Sent: Thursday, October 31, 2002 2:14 PM
To: CF-Talk
Subject: Need assistance with listbox on a form
I have a page in which employees can update information that is
contained in
their record in my SQL table. I recently added a multi-select list box
with
a list of foreign languages that they can choose from if it's applicable
to
them.
If a user selects a foreign language and submits their changes, it
works.
If they change their address, but don't speak a foreign language and the
list box doesn't have anything selected, then they get this lovely error
message:
GetOld.FLanaguage IS ""
Error near line 126, column 24.
_____
Error resolving parameter GETOLD.FLANAGUAGE
The column FLANAGUAGE is not present in the query named GETOLD. It is
likely
that you have misspelled the name of the column.
The error occurred while processing an element with a general identifier
of
(CFIF), occupying document position (126:1) to (126:30).
Ok, so FLangauge is a field in the query, so it isn't that. Here's the
piece
of the page where it's failing at:
<cfif GetOld.FLanaguage IS "">
<cfset chgFLanguage = "">
<cfelseif GetOld.FLanguage IS NOT '#FLanguage#'>
<cfset chgFLanguage = #FLanguage#>
</cfif>
Is the reason why I am having this problem have to do with the fact that
this is a multi-select list box and if so, how do I correct this to make
this work correctly?
For anyone who wants to see the code for the list box it is:
<tr>
<td><b>Foriegn Languages You May Speak:</b></td>
<td><cfselect name="FLanguage" size="5" multiple>
<CFOutput query="GetLanguages">
<CFIF
ListFindNoCase(EditNameQry.FLanguage,GetLanguages.LanguageName)>
<CFSET PGSelected ="Selected">
<CFELSE>
<CFSET PGSelected ="">
</cfif>
<Option #PGSelected#
value="#LanguageName#">#LanguageName#</option>
</cfoutput>
</cfselect></td>
</tr>
Thank you,
Aimee Clark
Web Developer
Stinson Morrison Hecker LLP
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm