> Does anyone know if it is possible to read session variables 
> withing Javascript?
> 
> Example,
>     Have a session variable called "CompareList"
> 
>  <CFSET session.CompareList = "" />
>  <input type="hidden" name="Session.CompareList" 
> value="#Session.CompareList#" />
> 
> 
> JS:
>     function ReadList() {
>         var CurrCompareValues = 
> document.myform.Session.CompareList.value; 
>         // This doesn't work because of the Session.Comparelist 
>        alert(CurrCompareValues);
>     }
> name.

The short answer is no, you can't read Session variables within JavaScript.
However, you can output them within form fields or JavaScript variables
within your HTML page, and read those from JavaScript.

The problematic part of your code is your form field name. The dot (".") is
a JavaScript metacharacter, so you won't want to name your form field
"Session.CompareList".

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199794
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to