When I try to populate a form field which is not required in form validation doesn't repopulate. Let's say I have a field but I don't want it to be required but I want it to be repopulated. How can I do it ? I think this is a bug for codeigniter.
This piece of code solved my problem. But I have to use helpers for that. At least I have a solution.
function value_field($field, $default='') {
return (isset($_POST[$field])) ? $_POST[$field] : $default;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With