Hi,
I have the following drop down menu that displays information from a look up table in my database.
<CFQUERY NAME="GetUnits" DATASOURCE="intranet" DBTYPE="ODBC">
SELECT Item_No, Unit_Desc, Serial_No
FROM Inv_Roots2
ORDER BY Item_No
</CFQUERY>
<A NAME="Unit">
<SELECT NAME="Unit" TABINDEX="17" CLASS="SelectBox">
<CFLOOP QUERY="GetUnits">
<CFIF ParameterExists(URL.SelectedOption) AND URL.SelectedOption IS "#Item_No#" OR ParameterExists(Form.Unit) AND Form.Unit IS "#Item_No#" OR ThisUnit IS "#Item_No#">
<CFSET SELECTED=" SELECTED">
<CFELSE>
<CFSET SELECTED="">
</CFIF>
<OPTION VALUE="#Item_No#"#SELECTED#><CF_CAPITALIZE UNSHOUT="Yes" TITLECASE="Yes" HYPHENATEDWORDS="Yes" ALLCAPACRONYMS="Yes">#Item_No# - #Unit_Desc#</CF_CAPITALIZE>
</CFLOOP>
</SELECT>
Now, I only take the item_no value and insert that into my table currently.
What I would like to know if I wanted to make a modification to also insert the unit_desc and the serial_no, can I tweek my current code or do I need to implement something like the cftwoseletedrelated function?
Thanks John
I have the following drop down menu that displays information from a look up table in my database.
<CFQUERY NAME="GetUnits" DATASOURCE="intranet" DBTYPE="ODBC">
SELECT Item_No, Unit_Desc, Serial_No
FROM Inv_Roots2
ORDER BY Item_No
</CFQUERY>
<A NAME="Unit">
<SELECT NAME="Unit" TABINDEX="17" CLASS="SelectBox">
<CFLOOP QUERY="GetUnits">
<CFIF ParameterExists(URL.SelectedOption) AND URL.SelectedOption IS "#Item_No#" OR ParameterExists(Form.Unit) AND Form.Unit IS "#Item_No#" OR ThisUnit IS "#Item_No#">
<CFSET SELECTED=" SELECTED">
<CFELSE>
<CFSET SELECTED="">
</CFIF>
<OPTION VALUE="#Item_No#"#SELECTED#><CF_CAPITALIZE UNSHOUT="Yes" TITLECASE="Yes" HYPHENATEDWORDS="Yes" ALLCAPACRONYMS="Yes">#Item_No# - #Unit_Desc#</CF_CAPITALIZE>
</CFLOOP>
</SELECT>
Now, I only take the item_no value and insert that into my table currently.
What I would like to know if I wanted to make a modification to also insert the unit_desc and the serial_no, can I tweek my current code or do I need to implement something like the cftwoseletedrelated function?
Thanks John