CodeIgniter Forums

Full Version: Form Validation / Removing values from $_field_data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In CI2 I was able to remove values from $_field_data, and subsequent calls to set_value() for a particular field would then return an empty string. I find this handy, because on some forms I could unset the entire $_field_data array when a form submission was successful, and instantly show an empty form for a new submission.

In CI3 this isn't working. I can verify that the $_field_data is unset, but calls to set_value() for a particular field that was unset will still show the value.

Rather than try to figure out what's going on by myself (not because I'm lazy but just lack the time), I was hoping that somebody could shed some light on this issue. What's the cleanest way to unset the data so that set_value() doesn't have anything to repopulate?

EDIT -------------------------------------------------------

It didn't take long to figure out the problem, and it was the way that CI determines if the form validation object contains the value before switching to $_POST values. I was able to figure out a solution, but it really changes the way set_value() works. I don't like it, but it is what it is.