![]() |
jump to error anchor on failed 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: jump to error anchor on failed form validation (/showthread.php?tid=37403) |
jump to error anchor on failed form validation - El Forum - 01-08-2011 [eluser]Unknown[/eluser] I have posts page on which there is form with some fields. On successful validation I redirect to same page and everything is great. But when validation fails I can't redirect so I call the method that displays the post in the first place. Post is displayed with validation errors but the URL is set to "commentSubmit" method that I called. For example: post URL /display/post/post-name/ On success I go to same URL with redirect, but on fail I end up with: /display/commentSubmit Is it possible to somehow redirect and have validation errors saved so I can display them? Or some other way to get the URL to be /display/post/post-name/ again. This is important for me because I display errors just over comment form which is way down on pages. So when error happens I don't see the error message unless I scroll down. On successful pages I solved the problem with on page links(redirect to /display/post/post-name/#error). Or is there maybe some other way to jump to position where I display errors. Thx. |