[eluser]Unknown[/eluser]
I have attended my validation library by adding another rule for no spacing. But it is not working, is there anything i miss out?
In my "system\application\libraries" I added MY_Validation
Code:
<?php
function no_space($str)
{
return ( ! preg_match("#\s#", $str)) ? FALSE : TRUE;
}
?>
In my "system\language\english\validation_lang"
I added this code
Code:
$lang['no_space'] = "The %s field may not contain spaces.";
In my function i call the rule
Code:
$this->form_validation->set_rules('user_username','Username','trim|required|no_space[user_username]|xss_clean');