Weird problem using arrays as field names and form validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Weird problem using arrays as field names and form validation (/showthread.php?tid=20003) |
Weird problem using arrays as field names and form validation - El Forum - 06-25-2009 [eluser]darytas[/eluser] hey, first, thanks for listning to my problem. it is, kinda weird, but let me explain it. I read much about using arrays as field names in CI and it seems like something experimental or just not working as intended. I found the solution with the custom MY_Validation and MY_Input (which is no longer needed as of 1.7.1 i read somewhere) - but in the end, it's not working like a charm. The validation only works, if I - before the validation - access every single value of the folloing by the following line. Code: $this->input->post('smsform[sender]'); If I put this line, then "smsform[sender]" will validate. But, I guess that's not the way it should work, am I right? Code: $this->validation->set_rules( array( Form is define like this: Code: <input type="text" name="smsform[recipient]" id="recipient-field" class="field text large" value="<?= set_value(array('smsform', 'recipient'))?>" /> Problem Form validation only works when I access every single value before the validation ran. Any Ideas? Weird problem using arrays as field names and form validation - El Forum - 06-25-2009 [eluser]Thorpe Obazee[/eluser] Try using the new Form Validation. I'm sure using arrays as field names work with the form validation class. Weird problem using arrays as field names and form validation - El Forum - 06-25-2009 [eluser]darytas[/eluser] [quote author="bargainph" date="1245936060"]Try using the new Form Validation. I'm sure using arrays as field names work with the form validation class.[/quote] Worked, thanks dude. |