Pagination throws form validation error when clicking links - 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: Pagination throws form validation error when clicking links (/showthread.php?tid=53686) |
Pagination throws form validation error when clicking links - El Forum - 08-03-2012 [eluser]zulubanslee[/eluser] Using pagination library. Everything is working except when I click on one of the page links, it gets intercepted by the form validation library. Problem is it doesn't print anything, no errors nothing. Here is my controller: Code: function search_by_zip_result() Pagination throws form validation error when clicking links - El Forum - 08-03-2012 [eluser]john_j[/eluser] Why don't you bypass the validation if it is a click from page links? Pagination throws form validation error when clicking links - El Forum - 08-03-2012 [eluser]zulubanslee[/eluser] How do you do that? Pagination throws form validation error when clicking links - El Forum - 08-03-2012 [eluser]Aken[/eluser] $this->form_validation->run() will return false on a normal page load, not just when POST values have been submitted. Your controller is done in a really weird order. It should be more like this: Code: if ($this->form_validation->run() === false) See the user guide example for more details. Pagination throws form validation error when clicking links - El Forum - 08-04-2012 [eluser]zulubanslee[/eluser] It returns the error both ways. I suspect it has something to do with uri segment but I've tried all sorts of things Pagination throws form validation error when clicking links - El Forum - 08-04-2012 [eluser]zulubanslee[/eluser] I think the problem is that the my query is too complicated to use the built in pagination. The pagination examples are for queries that grab one table with no parameters. The pagination does not carry over all of the parameters that I need for each click of the link. Pagination throws form validation error when clicking links - El Forum - 08-04-2012 [eluser]Aken[/eluser] The Pagination library has nothing to do with queries, complex or otherwise. You supply the data it uses to create links. Pagination throws form validation error when clicking links - El Forum - 08-05-2012 [eluser]zulubanslee[/eluser] So I have learned. I'm building parameterized query links. Cheers. |