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

Setting session variable - Onclick 3

Status
Not open for further replies.

MC77

Technical User
Jul 24, 2001
8
0
0
US
I have a session variable defined in the application.cfm:

<cflock name="sLogin_Lock" timeout="30" type="exclusive" >
<cfset session.TreeView = 'true'>
</cflock>

In a subsequent .cfm I have a checkbox that has checked/value of the session variable.

<cfinput type="checkbox" name="treeShow" checked="#session.TreeView#"
value="#session.TreeView#" label="Show Applications Window"
onClick="#session.TreeView# = treeShow.selected;"/>

When clicked I want to set the session variable to be equal to treeShow.selected value, but this does not work and errors with "Left side of assignment operator must be variable or property"

I have tried a few variations of using # , etc....any assistance would be greatly appreciated.
 
i dont use cfform or cfinput at all but unless i am very mistaken about CFFORM, this will not work:
Code:
onClick="#session.TreeView# = treeShow.selected;"/>

how exactly is the page going to edit that session variable after coldfusion has finished processing the page? cfform writes a standard html form and the javascript for any validation etc.. that you put into the CFINPUT tags. you would need to put a javascript function call in that onclick attribute to do what you need. use a javascript function to call a hidden iframe or something that can change that session variable.

=========================================
Don't sweat the petty things and don't pet the sweaty things.
 
You'd have to reload the page (so CF can re-process it) if you want that onClick to register the onlick. Which might be very annoying to the user.

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top