Form Validation max_length not working? - 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 max_length not working? (/showthread.php?tid=43324) |
Form Validation max_length not working? - El Forum - 07-07-2011 [eluser]Jacob Graf[/eluser] I am trying to use max_length[10] for some fields with form_validation and I keep getting the following error upon page load. If I remove all of the max_length checks, everything works great! Code: A PHP Error was encountered Here is an example of one of my rules... Code: array ( Form Validation max_length not working? - El Forum - 07-07-2011 [eluser]CodeIgniteMe[/eluser] Did you pass a multidimentional array or just that simple array? I believe you should pass it like this. Code: $config = array( Form Validation max_length not working? - El Forum - 07-07-2011 [eluser]Jacob Graf[/eluser] Yes, I passed the multi-dimensional. I just posted one of the sub-arrays as an example. Form Validation max_length not working? - El Forum - 07-07-2011 [eluser]CodeIgniteMe[/eluser] Debug your array with var_dump() or print_r() before you set it to the validation rules Form Validation max_length not working? - El Forum - 07-07-2011 [eluser]Jacob Graf[/eluser] Here is the output from print_r. I only added the max_length back to the last_name field and verified it was throwing the error. I don't see anything out of place, do you? Code: Array Form Validation max_length not working? - El Forum - 07-15-2011 [eluser]Jacob Graf[/eluser] Anybody? Form Validation max_length not working? - El Forum - 07-16-2011 [eluser]Aken[/eluser] Does your run() function contain the group you're trying to use? Code: if ($this->form_validation->run('register') === false) ... |