codeigniter-base-model icon indicating copy to clipboard operation
codeigniter-base-model copied to clipboard

trim validation

Open Ihabafia opened this issue 10 years ago • 1 comments

Hi,

I noticed that if I added a few spaces before one of the fields and I ask to trim it as a validation, I noticed that the field got trimmed only if there is a validation errors in one of the other fields but if everything is fine and that field does have few spaces it does add these spaces to the DB.

Please advise.

Ihabafia avatar Oct 28 '14 15:10 Ihabafia

you need to trim is manually, in before_create use php function trim($field)
validation trim just remove the spaces when field have no other character

musman92 avatar Oct 31 '14 05:10 musman92