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

Trim white space from text field input in ChronoForms.

Overview

Text fields in CF do not automatically remove leading or trailing spaces, which can cause data inconsistencies.
Add a Custom Code action after form submission to apply the trim function to the specific text field data.

Answered
ChronoForms v6
om 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?
Gr 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.