Input trimming

mxmauro

New Member
Hi, I have a form with some inputs like name and address.

I want to trim text spaces before validating the field but I don't know where to do that and how.

I was thinking in a custom PHP form plugin but is there a way to interate thru all input fields without doing the classic {tablename___element} (to avoid mantaining the code if I add/delete a field)

Javascript validation may be used but I want to avoid malicious users from sending invalid data via non-formal data posting.

Thanks,
Mauro.
 
Best bet would probably be to make your first validation a custom PHP one, which does:

return trim($data);

... and is set to 'replace' rather than match.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top