communication between javascript and CF ..

How would you pass a javascript variable as a query string in a javascript function ?
function funct1()
var f = document.forms["WORD_LIST"];
var word=f.elements['CHKCODE'].value;
Can this code be implemented ?
Please be fast..!
Who is Participating?
bigbadbConnect With a Mentor Commented:
You can pass a javascript var to another page from a javascript function.


location.href = "../main.cfm?" + word;

however you are not able to urlencodeformat within a javascript function because by the time the javascript function is executed all the server side cold fusion code has been parsed.  SO if you need to urlencode this javascript value you could pass it to an intermediate page and then urlencode that variable.  Then call your final destination page with the urlencoded javascript var

ramkisivanAuthor Commented:
Cute the code can be perfectly implemented
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.