Forums

Text Field does not trim white space at the beggning or the end

omidhz 14 Jun, 2017
I think Text fields in CF should have the php trim function by default. Right now, users can enter blank space at the beginning and end of their input.
How/where can I add this php code to my Text field?
GreyHead 14 Jun, 2017
Answer
1 Likes
Hi omidhz ,

You can clean up the data after the form is submitted using code like this in a Custom Code action:
<?php
$this->data['text1'] = trim($this->data['text1']);
?>

Bob
This topic is locked and no more replies can be posted.