Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 13th, 2018, 09:04 AM
bkurzbuch bkurzbuch is offline
Regular Contributor
 
Join Date: May 2014
Posts: 71
Default Trim all space's

I have a project where a "Partner Code" is used in 3 places. Two are in body copy and 1 in a URL. Using the "Case selection for a name field Rule" i can get them to print as all caps or lower case where I need them to be. My questions is how do I trim out all spaces. I found how to remove leading and trailing spaces, but I need to remove all spaces incase the end user in Marcom enters it with a space somewhere. Thank You.
Reply With Quote
  #2  
Old June 13th, 2018, 09:17 AM
GreggRusson GreggRusson is offline
Junior Community Member
 
Join Date: May 2011
Location: Seattle
Posts: 34
Default Re: Trim all space's

http://forums.pti.com/showthread.php?p=20745#poststop
Reply With Quote
  #3  
Old June 13th, 2018, 10:11 AM
bkurzbuch bkurzbuch is offline
Regular Contributor
 
Join Date: May 2014
Posts: 71
Default Re: Trim all space's

Hi Greg

Thanks for the reply. I tried both of the options in the link you provided, but I can't get it to remove a space in the middle of the variable. I need the variable to look like "ABC123" but I'm getting "ABC 123". Thanks
Reply With Quote
  #4  
Old June 14th, 2018, 06:13 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Trim all space's

I bet you're variable is actually returning a non-breaking space character ( ) rather than an actual space. Try this:
Code:
return RawTextFromTagged(Field("Partner Code")).replace(/\s/g, '');
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.