Welcome Guest, Not a member yet? Register   Sign In
alpha rule doesn't works with accents
#1

[eluser]Marcello Benigno[/eluser]
Hi,

When I try to validate words with accents in Portuguese language (like operação, município, idéia...), validation class returns false. I'm trying with alpha rule.

How can I solve it?

Thank you!
#2

[eluser]n0xie[/eluser]
Create your own rule that also checks for accented characters. The default alpha rule only allows A-Z & a-z.
#3

[eluser]Marcello Benigno[/eluser]
Any example? I tried this:

function alpha($str)
{
return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
}


Did not works, Any ideas? Thanks in advance...
#4

[eluser]Marcello Benigno[/eluser]
Any example? I tried this:

function alpha($str)
{
return ( ! preg_match("/^([A-Za-zá-úÁ=Ú.\s])+$/i", $str)) ? FALSE : TRUE;
}


Did not works, Any ideas? Thanks in advance...




Theme © iAndrew 2016 - Forum software by © MyBB