Welcome Guest, Not a member yet? Register   Sign In
Form Validation / Removing values from $_field_data
#1

(This post was last modified: 12-07-2015, 11:38 PM by skunkbad.)

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB