CodeIgniter Forums

Full Version: set_value not working when using form_input function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have code like this
for($i = 1; $i<= 16; $i++){
echo form_input('field'.$i, set_value('field'.$i));
echo br();
to generate a bunch of fields(no this isn't for a live site) and when it fails(i have field1 as required and leave it blank) then the form doesn't repopulate but when I stick in $_POST['field'.$i] as the value it works after the submit. (beforehand it throws errors of course)

Why is set_value not working?

El Forum

Reading set_value() docs...