Welcome Guest, Not a member yet? Register   Sign In
Form validator rule alpha and UTF-8
#1

[eluser]davlyn[/eluser]
When I set the alpha validation rule for a input field in my form and when I type characters like ŠĐČĆŽ etc the rule doesn't see those characters as letters. I use a database that has UTF-8 encoding. How do I modify the regex ( "/^([a-z])+$/i" ) to include those letters?

EDIT: I can do it with "/(*UTF8)^([a-zšđčćž])+$/i" . Is there a better solution?
#2

[eluser]Narf[/eluser]
Create a callback rule, the already included 'alpha' rule is only supposed to work with latin characters (and next version will use ctype_alpha() instead of a regular expression).
#3

[eluser]davlyn[/eluser]
[quote author="Narf" date="1352490550"]Create a callback rule, the already included 'alpha' rule is only supposed to work with latin characters (and next version will use ctype_alpha() instead of a regular expression).[/quote]

Thank you for answering. For now I just extended the Form_validation class (added MY_ prefix etc).

Btw can you give me a link where I can find future changes (like the one you just written about ctype_alpha() being used in the next version).
#4

[eluser]Aken[/eluser]
https://github.com/EllisLab/CodeIgniter
#5

[eluser]davlyn[/eluser]
Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB