CodeIgniter Forums
Few questions about 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: Few questions about Form_Validation (/showthread.php?tid=44726)



Few questions about Form_Validation - El Forum - 08-24-2011

[eluser]jotorres1[/eluser]
Hello all, new here to the community. I was wondering if there is a way to know if errors exists within form_validation.

For example, I would like to be able to do something like this:

Code:
<?php if(validation_errors() == true):?>
<ul>
  <li>&lt;?php echo form_error('username'); ?&gt; etc... </li>
</ul>
&lt;?php endif;?&gt;

Question 2, Instead of using:
Code:
<li>&lt;?php echo form_error('username'); ?&gt; etc... </li>
Would I be able to use this instead? for the previous example:
Code:
$this->form_validation->set_error_delimiters('<li class="error">', '</li>');

Q3, for the rules: Is it possible to use some native rules, and at the same time use a callback_ validation function?

Thanks!