$val = Validation::forge();Harro Verton wrote on Thursday 12th of January 2012:Did you run the validation? The last error message is from your authentication solution, not from the validation.
kevin sakhuja wrote on Saturday 14th of January 2012:Try this: $val = Validation::forge();
$val->add('pass', 'password')->add_rule('required')->add_rule('min_length',3);
$val->add('uname', 'User Name')->add_rule('required'); if($val->run())
{
echo "ok";exit;
}
else
{
$val->set_message('required', 'The field :label must be filled out before auth is attempted.');
echo $val->error('uname');
echo $val->error('pass');
}
<?php echo Form::label('Name', 'name'); ?> <?php echo Form::input('name', Input::post('name')); ?> <?php echo $val->error('name'); ?>
<?php echo Form::label('Name', 'name'); ?> <?php echo Form::input('name', Input::post('name')); ?> <?php echo $val->error('name')->get_message(false, '<div class="alert">', '</div>'); ?>
It looks like you're new here. If you want to get involved, click one of these buttons!