Welcome Guest, Not a member yet? Register   Sign In
Function set_value() not working as expected
#45

[eluser]Unknown[/eluser]
So, the problem is how set_value works when validation is also being used (as many have pointed out).

From the validation rules section in the documentation ...

"Note: You can also use (as a rule) any native PHP functions that permit one parameter."

So, for any form variables not needing validation, use something that will always be true, like isset and set_value will return the $_POST variable, as desired

$this->form_validation->set_rules('field', '', 'isset')

It's extra code in the controller, but this will allow set_value() to behave as expected when you are using validation ... and it will probably keep working through an upgrade if they don't get around to fixing.

It could be easier, no doubt (and I suspect others have posted the same/similar work-around).


Messages In This Thread
Function set_value() not working as expected - by El Forum - 11-11-2008, 09:51 AM
Function set_value() not working as expected - by El Forum - 11-11-2008, 10:22 AM
Function set_value() not working as expected - by El Forum - 11-11-2008, 12:34 PM
Function set_value() not working as expected - by El Forum - 11-12-2008, 01:20 PM
Function set_value() not working as expected - by El Forum - 11-23-2008, 10:16 PM
Function set_value() not working as expected - by El Forum - 11-23-2008, 10:47 PM
Function set_value() not working as expected - by El Forum - 11-24-2008, 12:16 AM
Function set_value() not working as expected - by El Forum - 01-19-2009, 10:30 AM
Function set_value() not working as expected - by El Forum - 02-08-2009, 12:21 AM
Function set_value() not working as expected - by El Forum - 02-08-2009, 04:32 AM
Function set_value() not working as expected - by El Forum - 02-08-2009, 10:16 AM
Function set_value() not working as expected - by El Forum - 02-08-2009, 11:59 AM
Function set_value() not working as expected - by El Forum - 02-24-2009, 11:52 AM
Function set_value() not working as expected - by El Forum - 07-15-2009, 10:45 AM
Function set_value() not working as expected - by El Forum - 07-15-2009, 12:33 PM
Function set_value() not working as expected - by El Forum - 11-10-2009, 11:42 AM
Function set_value() not working as expected - by El Forum - 11-10-2009, 12:08 PM
Function set_value() not working as expected - by El Forum - 12-13-2009, 09:43 PM
Function set_value() not working as expected - by El Forum - 01-01-2010, 11:42 PM
Function set_value() not working as expected - by El Forum - 01-02-2010, 09:39 AM
Function set_value() not working as expected - by El Forum - 05-03-2010, 12:45 AM
Function set_value() not working as expected - by El Forum - 06-17-2010, 03:34 AM
Function set_value() not working as expected - by El Forum - 06-25-2010, 06:32 AM
Function set_value() not working as expected - by El Forum - 08-17-2010, 03:08 PM
Function set_value() not working as expected - by El Forum - 09-13-2010, 09:38 PM
Function set_value() not working as expected - by El Forum - 09-23-2010, 04:33 AM
Function set_value() not working as expected - by El Forum - 10-12-2010, 01:33 PM
Function set_value() not working as expected - by El Forum - 12-15-2010, 02:08 PM
Function set_value() not working as expected - by El Forum - 01-19-2011, 02:30 AM
Function set_value() not working as expected - by El Forum - 04-20-2011, 09:22 AM
Function set_value() not working as expected - by El Forum - 05-04-2011, 06:30 AM
Function set_value() not working as expected - by El Forum - 05-05-2011, 03:19 PM
Function set_value() not working as expected - by El Forum - 06-21-2011, 01:12 AM
Function set_value() not working as expected - by El Forum - 08-05-2011, 05:03 PM
Function set_value() not working as expected - by El Forum - 08-05-2011, 05:14 PM
Function set_value() not working as expected - by El Forum - 04-03-2012, 10:18 AM
Function set_value() not working as expected - by El Forum - 05-14-2012, 01:50 PM
Function set_value() not working as expected - by El Forum - 07-28-2012, 01:42 AM
Function set_value() not working as expected - by El Forum - 07-28-2012, 02:22 AM
Function set_value() not working as expected - by El Forum - 08-26-2012, 12:58 PM
Function set_value() not working as expected - by El Forum - 08-26-2012, 01:16 PM
Function set_value() not working as expected - by El Forum - 08-26-2012, 11:07 PM
Function set_value() not working as expected - by El Forum - 08-27-2012, 10:07 AM
Function set_value() not working as expected - by El Forum - 08-27-2012, 07:08 PM
Function set_value() not working as expected - by El Forum - 02-13-2014, 10:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB