Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing CF variables through open( ) in JS then perform CFQUERY 2

Status
Not open for further replies.

markbanker

Programmer
Mar 6, 2001
37
US
I am taking a user's input in a text field and then upon Submit, calling a JavaScript function to open a new window. I want to perform a CFQUERY in the new window and use the value retrieved from the text field to limit the result set. The error I get states that the QUERY doesn't recognize the variable that has been passed. I've tried making specific reference to the form and field without success. Any suggestions?
 
If I'm reading this right, this is what I would do.

In your javascript function, you would need to have something like this:

window.open('myCFM.cfm?myTxtFld=' + myform.myTxtFld.value,'_blank','');

myCFM.cfm would have the reference URL.myTxtFld in your query then.

The form variables are only passed to the action page in your form tag. This is why you must explicitly send them with javascript.

MCMoyer
 

How to assign a javascript object to cf variable?

For example,

<cfset text=document.form.value>
How to make this workable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top