Welcome Guest, Not a member yet? Register   Sign In
Using Arrays as Field Names
#21

[eluser]Krzysiaczek[/eluser]
[quote author="pickupman" date="1275416685"]Guess, I never had tried this before. I tried this and it worked.
Code:
<?php
      $options = set_value('options[]');
      $i = 0;
      foreach($ids as $id) : ?>

         <input type="text" name="options[]" id="options_<?=$id;?>" value="<?=$options[$i];?>" />

<?php
      ++$i;
      endforeach; ?>
...cut...
[/quote]

Hi

Pickupman's solution has worked for me to set_value() (thanks for that) but form_error() was returning only the last found error (for each field in an array). I've found the solution and added my few cents to make it work better. It's not optimal but works for me Smile

You can find it here:
http://pgmmer.blogspot.com/2011/05/codei...-with.html

Thanks
Chris




Theme © iAndrew 2016 - Forum software by © MyBB