Welcome Guest, Not a member yet? Register   Sign In
validate alpha numeric and blankspace
#1

[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
#2

[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.
#3

[eluser]mattthehoople[/eluser]
does alpha_num not allow spaces? It seems to...

$fields = array(
'fname' => 'required|trim|alpha_num',
etc...
#4

[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]
#5

[eluser]matt2012[/eluser]
plus 1 for space + alpha_numeric very common for forms!
#6

[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.
#7

[eluser]ngkong[/eluser]
vote for alpha_space and alpha_numeric_space




Theme © iAndrew 2016 - Forum software by © MyBB