Mark Flewellen wrote:
> 
> So the question is can you set a session variable with javascript (onclick) 
> and then redirect them and if so what would the code look like, or would I be 
> better having a page that sets the session then redirects them to the correct 
> page.

Well,... yes and no =)

Javascript runs on the browser, so coldfusion doesn't know squat about 
what you do on the browser.

Of course, theoretically, you could use javascript to set session 
variables on the server using cfajax... but that'd be a lot of work and 
seems like it might be overkill... you'd have to make an ajax call to 
the server, and when it returned true, use javascript in the result 
function to relocate to the new page.

You'd probably be better off using javascript to set a cookie, then read 
the cookie on the next page.

And since session variables (generally) require cookies to be enabled 
(does anyone use cfid/cftoken stuff in the urls???), you'd probably be 
okay doing that.

Of course, submitting to an intermediary page first and then cflocating 
to the new url is probably the most RELIABLE.

Rick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232816
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to