Welcome Guest, Not a member yet? Register   Sign In
set_radio and set_checkbox have problems with value of 0
#19

[eluser]sparky672[/eluser]
[quote author="CroNiX" date="1384386338"]Any of the form_helper functions that retrieve a form value need at least one validation rule set up. set_value(), set_select(), set_radio(), set_checkbox(), etc., or they can't get the value.[/quote]

Good to know. Thank-you. Up to this point, this thread was a bit misleading in that regard.

[quote author="CroNiX" date="1384386338"]I don't know why you'd use an empty rule though. I'd at least make a callback function to see if that field was an int 0 or 1, or whatever allowable choices you have. If it goes in the database, it should be validated. What if I edited the form in my browser and sent "3" and that wasn't an allowable or valid choice? Your code would store it.[/quote]

That's a very good point to note, especially for anyone else that may be reading this thread. However, in this case, only somebody logged in as "admin" has access to my form.


Messages In This Thread
set_radio and set_checkbox have problems with value of 0 - by El Forum - 11-13-2013, 05:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB