How to send array in jquery to controller? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to send array in jquery to controller? (/showthread.php?tid=26232) |
How to send array in jquery to controller? - El Forum - 01-09-2010 [eluser]shinokada[/eluser] I am learning ajax with jquery and CI. I am not doing right with the following jquery code and a controll function. I think I am not doing right with this line. $.getJSON( 'phpjquerybook/inline_editing_do', {'id':id,'field_name':field_name,'value':this.value}, or function inline_editing_do($id=null){ $id=(int)$id['id']; $field_name = addslashes($id['field_name']); $value= addslashes($id['value']); I think I am not sending/receiving array correctly. Any help will be appreciated it. Thanks. Jquery code. Code: ... Controller Code: function inline_editing_do($id=null){ How to send array in jquery to controller? - El Forum - 01-09-2010 [eluser]T I[/eluser] <?=site_url('phpjquerybook/inline_editing_do')?> load the url helper in Controller. How to send array in jquery to controller? - El Forum - 01-09-2010 [eluser]shinokada[/eluser] Thanks Md. But it does not work. any more help? How to send array in jquery to controller? - El Forum - 01-09-2010 [eluser]T I[/eluser] It shd work. Code: $('#submit').click(function() { |