[eluser]ywftdg[/eluser]
I have a form on my website that allows users to enter keywords.
Typically in the form of something like:
dog, cat , my pet, animal
What I want to do, is remove any spaces (during the form submission to the db) before/after the commas (which could be 1, 2, 3 spaces depending on how spastic the user is).
The items above would result in:
dog,cat,my pet,animal
Notice it leaves the space in 'my pet'
Right now I am using this code below for the form field, but have tried, trim, ltrim, all sorts of things but nothing working. Any ideas?
Code:
<? $keywords = array ( 'name'=>'keywords' , 'id'=>'keywords' , 'value' => $this->validation->keywords, 'size' => '60', 'class' => 'formtextA' ) ?>
<?=form_input($keywords)?>