Answers.Body: <p>I checked with Dev and recommendation is to handle trailing spaces in the form layer (rather than in the API) -&gt; so to start here is the fix for D7WFC -&gt; <a href="https://github.com/colemanw/webform_civicrm/pull/319" rel="nofollow noreferrer">https://github.com/colemanw/webform_civicrm/pull/319</a></p>
  <p>If you see more of these in future -&gt; let me know and we'll track down the next form entry point e.g. profiles.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-06T22:39:16.083Z
Answers.Text: KarinG & @Coleman have put trailing space removal into webform-civicrm, thanks!
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-27T18:38:42.320Z
Answers.LastActivityDate: 2020-06-27T18:38:42.320Z
Answers.UserDisplayName: KarinG - Semper IT
Body: <p>We have a small but significant number of contacts with trailing spaces at the end of name fields (both first and last) as well as address fields (have found city name and postal code thus far). This has been going on for at least a year at a low rate, but perhaps picked up recently and is affecting more than 1% of new contacts. It has happened via webforms, via profiles used as snippets and profiles in event registrations and different instances of each, so it doesn't seem to be coming from any particular place.</p>
  <p><strong>Has anyone else seen anything like this?</strong> I can't get a search that works to find these, but they are pretty easy to see by scanning new contacts and looking for spaces before the comma that separates last from first names.</p>
  <p><strong>Update:</strong> In the last ten days, we've had a big increase in these spaces appearing. 12% of 375 recent new contacts had this issue in their last name (and some of those had it in other fields as well). This is much more than we've seen in the past, which suggests it is not actually people doing it themselves (unlikely that there is a sudden explosion in space bar use at the end of fields)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-06T01:49:33.543Z
Comments.Text: As a general comment I have seen this on all types of internet web forms when someone copy and pastes from something they are viewing in a browser, like another web page. Sometimes it puts in tabs at the beginning too.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-08T18:14:41.560Z
Comments.Text: What version of CiviCRM and Drupal are you using? Always helpful to put that up top. This sounds like it might be folks who are using autofill for forms in Chrome, Firefox etc. Or Lastpass, similar password management utilities. For your webforms, I imagine you could set up something using a regular expression to get rid of the trailing spaces on ubmission.
Comments.UserDisplayName: Joe McLaughlin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-08T22:19:42.977Z
Comments.Text: 5.24.6 on Drupal 7.70. Autofill is definitely something we thought of, but unclear what exactly the problem might be there.
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-09T20:40:29.657Z
Comments.Text: We have dozens of people a day filling out Civi event forms and webforms, and also have a significant number of spaces after people's names, and sometime after other fields. I feel pretty certain at this point that most of it is people actually entering spaces after their names. I've seen people that work here do it in person! It makes no sense whatsoever, but some people just press the space key after they type something. As suggested above, I think it could also be cut and paste sometimes.
Comments.UserDisplayName: desierto
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-22T15:49:45.637Z
Comments.Text: In the last ten days, we've had a big increase in these spaces appearing. 12% of 375 recent new contacts had this issue in their last name (and some of those had it in other fields as well). This is much more than we've seen in the past, which suggests it is not actually people doing it themselves (unlikely that there is a sudden explosion in space bar use at the end of fields).
Comments.UserDisplayName: Lars SG
Tags: <webform-civicrm><profile>
Title: Anyone noticing trailing spaces in name and address fields submitted via profile, webform, event registration etc?
ThreadText: # Anyone noticing trailing spaces in name and address fields submitted via profile, webform, event registration etc?
  
  (Asked by: username_0 on 2020-06-05)
  
  We have a small but significant number of contacts with trailing spaces at the end of name fields (both first and last) as well as address fields (have found city name and postal code thus far). This has been going on for at least a year at a low rate, but perhaps picked up recently and is affecting more than 1% of new contacts. It has happened via webforms, via profiles used as snippets and profiles in event registrations and different instances of each, so it doesn't seem to be coming from any particular place.
  
  **Has anyone else seen anything like this?** I can't get a search that works to find these, but they are pretty easy to see by scanning new contacts and looking for spaces before the comma that separates last from first names.
  
  **Update:** In the last ten days, we've had a big increase in these spaces appearing. 12% of 375 recent new contacts had this issue in their last name (and some of those had it in other fields as well). This is much more than we've seen in the past, which suggests it is not actually people doing it themselves (unlikely that there is a sudden explosion in space bar use at the end of fields)
  
  **Tags:** webform-civicrm, profile
  
  > **Comments:**
  > **username_1**: As a general comment I have seen this on all types of internet web forms when someone copy and pastes from something they are viewing in a browser, like another web page. Sometimes it puts in tabs at the beginning too.  
  > **username_2**: What version of CiviCRM and Drupal are you using? Always helpful to put that up top. This sounds like it might be folks who are using autofill for forms in Chrome, Firefox etc. Or Lastpass, similar password management utilities. For your webforms, I imagine you could set up something using a regular expression to get rid of the trailing spaces on ubmission.  
  > **username_0**: 5.24.6 on Drupal 7.70. Autofill is definitely something we thought of, but unclear what exactly the problem might be there.  
  > **username_3**: We have dozens of people a day filling out Civi event forms and webforms, and also have a significant number of spaces after people's names, and sometime after other fields. I feel pretty certain at this point that most of it is people actually entering spaces after their names. I've seen people that work here do it in person! It makes no sense whatsoever, but some people just press the space key after they type something. As suggested above, I think it could also be cut and paste sometimes.  
  > **username_0**: In the last ten days, we've had a big increase in these spaces appearing. 12% of 375 recent new contacts had this issue in their last name (and some of those had it in other fields as well). This is much more than we've seen in the past, which suggests it is not actually people doing it themselves (unlikely that there is a sudden explosion in space bar use at the end of fields).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2020-06-27. Score: 1
  
  I checked with Dev and recommendation is to handle trailing spaces in the form layer (rather than in the API) -> so to start here is the fix for D7WFC -> <https://github.com/colemanw/webform_civicrm/pull/319>
  
  If you see more of these in future -> let me know and we'll track down the next form entry point e.g. profiles.
  
  > **Comments:**
  > **username_0**: KarinG & @Coleman have put trailing space removal into webform-civicrm, thanks!  
  
  ---
  
  