![]() |
[Solved] Form Validation Callback With Array "selected[]" - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Solved] Form Validation Callback With Array "selected[]" (/showthread.php?tid=61258) |
[Solved] Form Validation Callback With Array "selected[]" - wolfgang1983 - 04-05-2015 I have a post array called selected on my form name="selected[]"; The set message does not work. I am still unsure on how to use callbacks with array. I trying to understand it. My callback message works fine with single post but not array[] How can I make call back pick up name="selected[]"; and display message. PHP Code: public function delete() { RE: [Solved] Form Validation Callback With Array "selected[]" - wolfgang1983 - 04-05-2015 (04-05-2015, 07:29 AM)riwakawd Wrote: I have a post array called selected on my form name="selected[]"; The set message does not work. I have solved my issue found out why for some reason when I submitted my form if I had error via callback the redirect was clearing it, so therefor no errors were showing up I had to call the main function with the view in it i.e $this->index(); PHP Code: <?php RE: [Solved] Form Validation Callback With Array "selected[]" - CroNiX - 04-06-2015 That's standard web behavior. POST and other globals get wiped out on the next page request, which a redirect does. You can also put the validation errors in session flashdata, or a cookie, or something else before redirecting and checking for it in your view, or do what you did to solve it. |