CodeIgniter Forums
form helper problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: form helper problem (/showthread.php?tid=31933)



form helper problem - El Forum - 07-07-2010

[eluser]ITT-Nico[/eluser]
Hey guys, i have a little problem with the form helper. i have the following code inside my view:

Code:
<?php
    echo form_open('content');
    $value = set_value('filter', 'empty');
    echo form_input('filter', $value);
    echo form_submit('submit', 'Filter');
    echo form_close();
    echo form_open('content');
    echo form_hidden('filter', '');
    echo form_submit('submit', 'Reset');
    echo form_close();
?>

but the value is not correct when the form is submitted... after submitting the value is reset to "empty", any ideas?

(im using the newest version of CI)

THx !


form helper problem - El Forum - 07-07-2010

[eluser]morehawes[/eluser]
I was stuck on this for a while too. It appears to be a bug in CI and occurs if you do not have a validation rule set for the field. I found a fix here (by jbreitweiser) that worked a charm for me :

http://ellislab.com/forums/viewthread/96617/P15/#689642

Hope that helps!


form helper problem - El Forum - 07-07-2010

[eluser]ITT-Nico[/eluser]
thx! works fine