The displayed value in the select isn't passed back to the form, so
just before you insert the new record you will need to query the
database for the name using the id passed through in the form, such
as...

<cfquery name="getProject">
SELECT project_name FROM tableName WHERE project_id = <cfqueryparam
cfsqltype="cf_sql_integer" value="#val(form.project_id)#" />
</cfquery>
<cfquery name="insert">
INSERT INTO otherTable (project_id, project_name) VALUES (
 #val(form.project_id)#,
 '#getProject.project_name#'
)
-- Use cfqueryparam on those values as well
</cfquery>


-Justin


On Mon, Sep 12, 2011 at 1:08 PM, Mo Lay <[email protected]> wrote:
>
> Hi peers,
>
> i have a cfselect working perfect
>
> <cfselect
>  name =PROJECT_NAME"
>  query"q1"
>  value="PROJECT_ID"
>  display="PROJECT_NAME"
> </cfselect>
>
> when inserting a record , i am getting the project_id value by calling
>
> <cfparameter value="#PROJECT_NAME#" cfsqltype="cf_sql_varchar">
>
> and i want also to be able to insert the "PROJECT_ANME" displayed name into 
> another field
>
> how can i capture that from the DropDown ?
>
>
>
> thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5581
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to