Question
Session variable and ajax
Session variables are confusing me.
I have a page with a form and and a <cfdiv>. I would like to submit the form and have it appear in the cfdiv.
Coldfusion.navigate works perfectly.
But now I want all previous submissions of the form to appear in the <cfdiv> as well (so if the user fill out the form 3 times, 3 entries will appear in the <cfdiv>). It would seem like session variables would be the answer, but the variables always get reset when going into the ajax code to generate the output for the cfdiv.
Are Ajax components/calls considered new sessions ? Is there a way to pass data to ajax code and have it remember it (without using cookies or large form submission)?
The set up is with the following quasi-code:
<session variables turned on>
script
var ascript = function()
Coldfusion.navigate('ajaxcode.cfm', 'ajaxObject', callback, callbackErr,'POST','theform')
/script
<can use session variables here with no problem>
<form id='theform'>
<whatever>
<button calls ascript onClick>
</form>
<cfdiv id='ajaxObject' />
------------------------------
ajaxcode.cfm
<cfoutput>
<can't use the same session variables here>
#Form.whatever#
</cfoutput>
--------------------------------------------
-thanx
I have a page with a form and and a <cfdiv>. I would like to submit the form and have it appear in the cfdiv.
Coldfusion.navigate works perfectly.
But now I want all previous submissions of the form to appear in the <cfdiv> as well (so if the user fill out the form 3 times, 3 entries will appear in the <cfdiv>). It would seem like session variables would be the answer, but the variables always get reset when going into the ajax code to generate the output for the cfdiv.
Are Ajax components/calls considered new sessions ? Is there a way to pass data to ajax code and have it remember it (without using cookies or large form submission)?
The set up is with the following quasi-code:
<session variables turned on>
script
var ascript = function()
Coldfusion.navigate('ajaxcode.cfm', 'ajaxObject', callback, callbackErr,'POST','theform')
/script
<can use session variables here with no problem>
<form id='theform'>
<whatever>
<button calls ascript onClick>
</form>
<cfdiv id='ajaxObject' />
------------------------------
ajaxcode.cfm
<cfoutput>
<can't use the same session variables here>
#Form.whatever#
</cfoutput>
--------------------------------------------
-thanx
