CodeIgniter Forums

Full Version: Form validation clears the form
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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.

El Forum

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

JB