I have an update page on which I need to show "user friendly" terms in a select box, 
even though the information in the table is actually a code number (e.g., the info is 
saved as "010-000" but the user should see "services.") The value from the select is 
then passed to a CFUPDATE on the following page. I can get the update to work properly 
if the user changes the value in the select box, but if she leaves the value unchanged 
the field gets updated to the "friendly" word instead of leaving the code value 
unchanged. 

Thanks for any assistance. I have included code below my sig.

Regards,

Marc Garrett

Here's the code that populates the select list:

<select class="editBox" name="fldCategory1">
    <option><cfoutput query="category_1">#fldCategory#</cfoutput></option>
    <cfloop query="categories">
    <option 
value="<cfoutput>#fldCategoryID#</cfoutput>"><cfoutput>#fldCategory#</cfoutput></option>
    </cfloop>  
</select>

Here's query category_1:

<cfquery datasource="datasource" name="category_1">
SELECT
 tblContacts.fldContactID,
 tblContacts.fldCategory1,
 tblCategories.fldCategory,
 tblCategories.fldCategoryID
FROM
 tblContacts, tblCategories
WHERE
 tblContacts.fldContactID LIKE '#id#'
 AND tblCategories.fldCategoryID = tblContacts.fldCategory1
</cfquery>

The update on the next page is simply:
<cfupdate datasource="datasource" tablename="tblContacts">


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to