Welcome Guest, Not a member yet? Register   Sign In
set_value, set_select, set_radio
#1

[eluser]MexiTek[/eluser]
I have noticed that when I use set_value(), set_select() or set_radio() they only work on the fields that have been passed through $this->form_validation->set_rules() function on the controller side.

I am sure I am just missing something. Has anyone had this problem before?
#2

[eluser]WanWizard[/eluser]
You haven't missed anything, this is by design.
#3

[eluser]MexiTek[/eluser]
So....What if I want to use these helper functions to repopulate fields that do not require validation? Is there some sort of work around?
#4

[eluser]WanWizard[/eluser]
In principle every piece of user input requires validation, as it can be manipulated.
You can work around that by validating them with an empty rule set.
#5

[eluser]MexiTek[/eluser]
I'll do that. Thanks for the help!
#6

[eluser]pickupman[/eluser]
[quote author="WanWizard" date="1274819719"]In principle every piece of user input requires validation, as it can be manipulated.
You can work around that by validating them with an empty rule set.[/quote]
+1...at least use
Code:
$this->form_validation->set_rules('field', 'field name', 'trim');

Trim may a little silly for radios and checkboxes, but you never know when some will manipulate your forms to be a little mischievous.




Theme © iAndrew 2016 - Forum software by © MyBB