![]() |
Called method in controller does not execute anything of a ajax-added field is submit - 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: Called method in controller does not execute anything of a ajax-added field is submit (/showthread.php?tid=81793) |
Called method in controller does not execute anything of a ajax-added field is submit - sprhld - 04-28-2022 Hallo! I have a form, where I add a dropdown, regarding an other dropdown. If I send the form, it gives me an error back, if I had not select something in the first dropdown. But if I do so, my ajax-form is shown and I could select something, but if I send the form, it does not execute anything. But the network tools shows data, which looks like the controller was called. Maybe someone can help me out. I have to say, this are my first experiences with ajax, so the problem could be there. This is my form: PHP Code: <?= form_open('coin/update/mass'); ?> Then I have this ajax-controller-part PHP Code: case 'getMassEditList': And this is the controller PHP Code: public function update($force = NULL) None of this "die()" breaks the execution. Also the redirect could not be this in this controller. The execution breaks if I send the form without executing the ajax-part. But if I do so, the request header shows, that the controller is called Code: scheme: https And I see the request with all data from the form, including the ajax-part Code: { I'm out, I have no idea what happens here. Maybe someone has an idea what I doing wrong here maybe or how to call the controller right, if an ajax-form-part is used... I don't know, this are my first ajax-lines I do. Thank you! RE: Called method in controller does not execute anything of a ajax-added field is submit - sprhld - 04-29-2022 Okay, I did it ![]() The reason was, that the changed CSFR key was only used within AJAX. A new given key has to be also in the main form. I just added one Code: $("input[name=cappx]").val(data.hash) Code: <script type="application/javascript"> |