CodeIgniter Forums
Form validation clears the form - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Form validation clears the form (/thread-54418.html)



Form validation clears the form - El Forum - 09-07-2012

[eluser]MightyBishop[/eluser]
Hi folks,

I love the form validation, but I was wondering if there was any way to make it return the form with the values that WEREN'T EMPTY, without completely clearing the form?

Bit frustrating if you've got a form with loads of entries and it was the last one you left blank!

Thanks for any help,

Best regards

JB


Form validation clears the form - El Forum - 09-07-2012

[eluser]srpurdy[/eluser]
Code:
<?php echo set_value('field_name');?>

Keep in mind right now by default every field will need to have a validation rule for this to work. Even if you don't need validation on that field. So you will need a blank validation on fields with no validation. If you don't put a validation for a specific field that field will never re-populate itself.


Form validation clears the form - El Forum - 09-15-2012

[eluser]MightyBishop[/eluser]
Thanks for that help. It would help if I read the manual!

JB