[eluser]Glazz[/eluser]
Hello,
I have a form where i have a lot of inputs that goes from the customer firstname to the customer password..
Well, i'm using the form validation library to validate my form inputs, it is working but i have one problem and i think the form library does'nt support this..
The password input when editing a customer
is not required but
if filled need to be validated, how can i do this, if i can... ?
The rule i use when creating the customer is:
Code:
trim|required|min_length[4]|max_length[20]
I know i don't need to use the required, since i'm using the min_length
I can create a callback but there is another way ?
Edit: I found the problem, i guess.
Since i'm using trim, if the input goes empty the value gets '' and not
null since the form validation uses
is_null it was not working properly...
Code:
if ( ! in_array('required', $rules) AND is_null($postdata))
I think this needs to be changed, since trim is a nice function, at least for me..