Re-populate form after failed validation and for editing (only one form).
I managed to repolulate a form after validatin fails.
in line 22, and the function 'oldval()' is in helpers/helpers.inc.php'.
Now, I need to repopulate the form for editing the user details. I just select the
data from the database based on the user's id and repopulate the form with that data.
The problem is that I need to put the data inside the form's "value" attribute but I can't
figure out how to do that for both situations (after form validation fails and edit user)
using the same form.
I have this for re-polulating the values after validation fails:
but for editing user I need another function.
value='<?= oldval('nome'); ?>'
I hope someone can give me some insights. Thanks in advance.