i understand that by putting the js values into a forn , i can read using
CF. But..what i am doing now is to create a dynamic drop down list based on
what is selected on the first drop down list, I need to query the database
using the value selected from the first drop down and create the second drop
down dynamically. There is no submit action so i cannot access the Form
variable nor the URL variable. Are there any other ways out??

-----Original Message-----
From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 6:51 PM
To: CF-Talk
Subject: RE: How to pass javascript variable to a cf tag?


> i am using a <cfquery> inside a javascript function. Question is how do i
> pass the javascript variable to the cfquery?
> this is an example of the code.
>
> function ChangeSelect(value)
> {
> <cfquery name="GetEmpName" datasource="#DSN#" dbtype="#DBType#">
>       select family_name || '  '  || given_name as name
>       from table where
>       company_code = 'the javascript variable'
> </cfquery>
> }

You know, I never get tired of saying this...

CF=Server Side
JS=Client Side

You need to pass the JS variables to the server to use them, you can't just
assume that it'll work on the page - CF compiles the page and then sends it
to the browser where JS runs

If you want to pass things back, either put them in a URL variable or put
them in a FORM

Remember that this will fall flat on it's face if the user either has JS
turned off or is behind a fire-wall that doesn't allow JS

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to