Form Validation with Array |
[eluser]Unknown[/eluser]
I'm trying to use Form Validation Class using array text-field. By the way, user manual says: Quote:* Using Arrays as Field Names But "set_value" returns array when it was given array as field name. So i think that the sample doesn't work correctly. It will output: Code: <input type="text" name="options[]" value="Array"... Is this a manual's mistake?
[eluser]gigas10[/eluser]
I have noticed this problem as well, but I have developed a work around. At the top of my page I fill up my array: Code: $pull_vals = array(); Then to repopulate, I pass in the filled up array of values as a parameter of form_dropdown. Code: <tr class="even"> An official fix for this would be nice.
[eluser]Unknown[/eluser]
Thank you for your reply. I attempted to fix "system/library/Form_Validation.php" below. Code: < Then, it works as well as the manual. Code: <input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> However, it is impossible to use "valid_email" rule. Because empty text-fields is regarded as invalid email addresses. Well... |
Welcome Guest, Not a member yet? Register Sign In |