Forums | Mahara Community
Hidden form field values not saving
09 June 2009, 17:04
09 June 2009, 19:09
Hi - yes, this is because the hidden element's definition of get_value (a Pieforms hook) simply returns the element's value, rather than looking in get/post. See lib/pieforms/pieform/elements/hidden.php
This is less than optimal for when people are playing with hidden values via JS - although it does add security in a sense, because you can always trust that the value you put in the pieform definition will be the one returned to you.
I've been meaning to make that behaviour configurable for a while. For now, I think commenting out the entire hook will give you the behaviour you want - as long as you remove the first three lines of pieform_element_hidden as well, and switch to 'defaultvalue' in your pieform definition.
11 June 2009, 18:43Thanks for the help. I've got it working now.