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!

Passing values to CF variables in JavaScript 1

Status
Not open for further replies.

cturland

Programmer
Sep 25, 2000
66
GB
Is it possible to set a session variable from JavaScript? I need to give the variable a null value after the javascript has been run.
 
Java script is client side and ColdFusion is Serverside.
variables in Javascript are stored in the clients computer memory and variables in ColdFusion are stored on the Webserver so there is no direct access.

Nothing you do in Javascript will effect a variable on the server until the browser makes another request. Your main options are:

To set the value of a hidden form variable in Javascript and ensure that this variable is posted to your next ColdFusion template, the template can then handle setting the session variable.

As above but appending a URL variable to the next template request.

Using a hidden frame and updating the invisible contents of the frame from javascript so that another ColdFusion template is called (wierd but you may have a reason to do this)

</thrud>
 
you can also build a custom tag i guess
but url params or hidden fields or hidden frames are fine enough
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top