Form_validation matches rule - 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: Form_validation matches rule (/showthread.php?tid=15781) |
Form_validation matches rule - El Forum - 02-14-2009 [eluser]Unknown[/eluser] Form validation works fine with array in the name of inputs. Ie: Code: <input name='user[address][city]'> But the rule: matches don't. I found in line 583 of Form_validation.php file Code: if (preg_match("/(.*?)\[(.*?)\]/", $rule, $match)) I changed this line to: Code: if (preg_match("/(.*?)\[(.*?)\]$/", $rule, $match)) I made a copy-and-paste of some lines of the Form_validation class to My_Form_validation Code: /** Thanks. |