CodeIgniter v4.5.0 Released! |
Need Help
I'm facing session related issue Once the user change the option, the other select tag's option will be dynamically add via ajax HTML Code: <!-- New Program Details --> JS Code: function getDegreeList(inst_id) { Once the data from the server has added to the select tag, i have submit my form, the session()->flashdata() did not works PHP Code: session()->setFlashdata() If i'm not dynamically add options to the select tag, the below code works PHP Code: session()->setFlashdata() Why i am facing this ? Reply me to this thread
It appears you are trying to add session data using Ajax and that is failing. That would make this an Ajax or JavaScript issue..
You might be better off trying a JavaScript support forum. Personally, I try to use frameworks such as Codeigniter to avoid JavaScript whenever possible.
It looks like your page is not reloading after returning the HTML object in $('#selectTag').
As far as I know, flashdata is only shown at page load. You can add additional data as result of the ajax post and use this to call a modal or a toast.
I have more input tags in that form, but i had only showcase two select tags
In my case When user submit the form, ajax can takes responsible to call the controller and,
(05-09-2024, 04:01 AM)Bosborne Wrote: It appears you are trying to add session data using Ajax and that is failing. That would make this an Ajax or JavaScript issue.. I have already worked with CI3, the same concept works in CI3 but in CI4 why i can't achieve this (04-25-2024, 12:35 AM)kenjis Wrote: @eelisland It is a known problem. @kenjis Thank you for getting the User Guide on the official site updated. |
Welcome Guest, Not a member yet? Register Sign In |