CodeIgniter Forums

Full Version: Passing array into controller with ajax
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

So I'm using this Jquery multiselect -

How do I pass the array of selected values into my controller using ajax?
The best I've managed so far is to Join the array with "/" so that my url to call becomes
"controller/function/1/2/3", and then have
function($id1, $id2, $id3)
in my controller, though obviously this is horrendous and I want to have an array of $selectedIds as the input to my controller.

I'm not sure if there's an elegant way to do this, I'm fairly new to codeigniter/ajax...