[eluser]vincej[/eluser]
Hi - I have the CSRF module turned on. I have a page which makes use of a Scriptaculous function:
Code:
var ajax = new Ajax.Updater(
'ajax_msg','http://localhost/mysite/index.php/welcome/ajax_cart', {method:'post',parameters:params,'csrf_clftoken':cct,onComplete:showMessage}
);
Using js alert messages I have managed to establish that the js runs right up to the point where the Ajax. Updater is called.
The code fails at the call. It is not getting to "weclome/ajax_cart" - again I have established this is die() calls.
I capture the CSRF token earlier in the js code with:
Code:
var cct = document.getElementsByName("csrf_clftoken")[0].value;
When I run the code I get the classic error message: "An Error Has Been Encountered - The Action You Have Requested is Not Allowed:.
So, my conclusion is that it is failing in the bit: {method:'post,parameters:params,'csrf_clftoken':cct,onComplete
howMessage}
);
Can anyone offer me any advice on what to do next to get the csrf_token to work in this call ?
Many thanks !!