validate alpha numeric and blankspace |
[eluser]Future Webs[/eluser]
Am i missing something or can I not use the validation to only allow alpha numeric AND blank spaces ? I spotted the alpha / alpha
[eluser]Armchair Samurai[/eluser]
With the default form validation rules, no, but it's easy enough to create your own validation rule to do just that.
[eluser]mattthehoople[/eluser]
does alpha_num not allow spaces? It seems to... $fields = array( 'fname' => 'required|trim|alpha_num', etc...
[eluser]Future Webs[/eluser]
thanks for the replies .. looks like if you use alplha_num (spelt wrong) it works because it ignores the rule if you use alpha_numeric (spelt correctly) it does not I know I can do a custom callback but for such a common thing to validate against its a shame there isnt something built in. I guess a standard regex option would be the best thing to have where you could do something like regex[my_expression_here]
[eluser]matt2012[/eluser]
plus 1 for space + alpha_numeric very common for forms!
[eluser]Xelgen[/eluser]
Yeah, I also miss some extended validation rules, and what I miss badly, is a way to invert rule, e.g. 'required|!matches[login]' for example, to restrict password being same as login, or for making more complicated validation.
|
Welcome Guest, Not a member yet? Register Sign In |