[eluser]Dinesh Shah[/eluser]
Banging my head and searching and reading this forum for last few hours.
form_validation refuses to work with callback. :-( PLEASE HELP!
Here is my code. CI simply does not call my callback.
Code:
$this->form_validation->set_rules('group', 'Group Name', 'trim|required|alpha|callback__group_exist[group]');
function _group_exist($values, $group)
{
$groups = $this->read_group_file();
print_r($grpups);
echo $values ;
echo "<br / ><br />";
echo $group . "<br / ><br />";
if ( isset($groups[$str]) )
{
$this->form_validation->set_message('group_exist', 'The group %s already exists');
return FALSE; // This is deliberate to see if the callback happens
}
return FALSE; // This is deliberate to see if the callback happens
}