• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Validation / Removing values from $_field_data

#1
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


Messages In This Thread
Form Validation / Removing values from $_field_data - by skunkbad - 12-07-2015, 11:03 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.