![]() |
2 forms 1 view validation_errors problem - 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: 2 forms 1 view validation_errors problem (/showthread.php?tid=36218) |
2 forms 1 view validation_errors problem - El Forum - 11-25-2010 [eluser]w84me[/eluser] Hi all, Propably I am missing somthing out here but I have a view with 2 forms. When I press submit and do the validation wherever I have the validation_errors() function it displays the errors. The errors are shown in both forms... How can I have the validation_errors() specific for each form? 2 forms 1 view validation_errors problem - El Forum - 11-25-2010 [eluser]w84me[/eluser] Maybe I should check the value of the submit button and echo the correct validation_errors() each time? 2 forms 1 view validation_errors problem - El Forum - 11-25-2010 [eluser]w84me[/eluser] That did the trick, Code: <?php if($_POST['submit'] == "Login") echo validation_errors('<p class="error">','</p>'); ?> 2 forms 1 view validation_errors problem - El Forum - 11-26-2010 [eluser]InsiteFX[/eluser] I would use CodeIgniters $this->input->post() instead of $_POST. InsiteFX |