Ah, this was fun. My issue was getting something that I could pass via Ajax.Request to the url which would of course then work in the PHP. Looking at it again, I’d just forgotten that I was in JavaScript. I’d gotten hung up on using the scriptaculous library.
For the record, I’ve ended up running through all the elements with a particular name and finding the value of the one that’s checked.
var sx=document.getElementsByName('poll_choice_id[]');
for(var j=0;j<sx.length;j++){
if(sx[j].checked==true){
s=sx[j].value;break
}
}
pars = 'onevote=' + onevote + '&pollid=' + pollid + '&poll_choice_id=' + encodeURIComponent(s);
Although actually I probably don’t need the encode s.
If anyone can improve this or point me to some fancy MODx-bundled js function that I’m unaware of, please do.