[eluser]JohnnyBravo[/eluser]
Hi!
I wrote a little script, that use a simple method to validate the posted values.
MY_Form_validation.php:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation
{
function is_greater_than($value)
{
if ($value > 100)
{
return FALSE;
}
return TRUE;
}
}
?>
The controller:
Code:
$this->form_validation->set_rules('list_limit', $this->lang->line('list_limit'), 'required|numeric|is_greater_than');
The view:
Code:
<?php echo validation_errors();
// It displays the errors correctly ?>
<?php echo form_input('list_limit', set_value('list_limit', $list_limit), 'class="number"') . "\n"; ?>
<?php echo form_error('list_limit', '<p class="info error-message"', '</p>');
// It doesn't display the error if I post a value that is greater than 100
?>
I don't know what is the problem...