![]() |
## overview
where is 'set_fields'. ## reference https://codeigniter4.github.io/userguide...ation.html ## detail The Codeigniter 3 Tutorial had a special variable called 'set_fields'. The effect was to display the 'post' data entered by the user. Now, when I have a simple "create lesson" controller like this, is there a way to keep the values entered by the user? or should I assign it to '$ _POST' and use 'post' in the template? PHP Code: /**
Do you mean set_value in CI3? If you validate via ajax you wouldn't have to repopulate the form.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
(04-09-2022, 10:44 AM)ignitedcms Wrote: Do you mean set_value in CI3? If you validate via ajax you wouldn't have to repopulate the form. thankyou for reply ignitedcms. the following address is for reference. However, looking inside the `set_value`, it seems that using `$ _POST` after all. ![]() http://www.codeigniter.com/userguide3/he...#set_value The tutorial doesn't seem to use `ajax`, but I'd like to take a look at the `ajax` page and create a validation mechanism. https://codeigniter.com/user_guide/libra...n#the-form https://codeigniter.com/user_guide/gener...light=ajax
thanks kenjis
Oh? It seems that I misunderstood that 'set_value' was gone. Thank you
I believe you were looking for 'set_fields' which is IIRC what it was historically named. Additionally in the old documentation there was a section under libraries > validation which discusses repopulating the form which appears to have been omitted, although as Kenjis has kindly pointed out is in the form helper section.
Off topic, I do prefer validating forms with ajax calling server side validation as it skips a step of having to manually repopulate input fields, though this is predicated on js being enabled in browser.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
thanks, ignitedcms.
Yes. It was exactly the old `set_values` on the Validation page of the old document. I would like to challenge later even if I use Ajax |
Welcome Guest, Not a member yet? Register Sign In |