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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to fill CF variable with value of a JavaSript variable?

Status
Not open for further replies.

kristof

Programmer
Jun 2, 2000
234
BE
Hey,<br><br>Filling JavaScript with CF is no problem,<br>but making it work in the other direction<br>seems a whole other story,<br><br>Anyone know the answer?<br><br>Thanx
 
The only way to do it is to put the value of a JS variable inside a form field and post the field.&nbsp;&nbsp;The handler script can then read that variable if the user had javascript turned on.&nbsp;&nbsp;<br><br>If you need to send complex variables, you need to use the WDDX JS library included with cold fusion to serialize the data into wddx first before submitting the form.<br><br>HTH
 
or you can pass the jscript variable with the url<br>nextpage.cfm?myjscript=any_value<br>and then in the nextpage.cfm you can fill a cf variable <br>&lt;cfset mycf=#url.myjscript#&gt;<br><br>the hidden field is a good way as well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top