[eluser]vincej[/eluser]
Thank you very much for this. Well I frigged around with it some more using your suggestion:
Code:
var token = {};
token['csrf'] = document.getElementsByName("csrf_clftoken")[0].value;
The For Loop goes here, then later:
Code:
var params = 'ids='+parameter_string+token['csrf'];
var ajax = new Ajax.Updater(
'ajax_msg','http://localhost/mysite/index.php/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
);
Unfortunately I still could not get it to work. Still the same "Action not allowed .... "
The variables came out looking much the same as yesterday according to Google Chrome:
Code:
<return>: undefined
ajax: Object
csrf: "csrf_clftoken"
parameter_string: "4061:1,"
params: "ids=4061:1,c741e91716543ca1dbfba5e1203cd576"
real_id: "4061"
real_value: "1"
temp: Array[3]
tempid: "li_id_4061"
this: Window
token: Object
I'm thinking that simply passing in the token value is not enough. Should I not have to pass in the token name in a key:value pair ??
I don't know what to do next - perhaps replace the Ajax.Update with JQuery Ajax ?? The for loop does not have to change.
Many Thanks !