salain, that helped once again. Problem was the regex. This is what I have ended up with....
seems to work with textareas as well:
PHP Code:
if ( ! function_exists('customAlpha')) {
function customAlpha($str)
{
if (!preg_match('/^[a-zA-Z0-9 .,\-\']*$/m', $str)) {
return FALSE;
} else {
return TRUE;
}
}
}