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

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old October 29th, 2012, 05:17 AM
spotless7325 spotless7325 is offline
Forum n00b
 
Join Date: Jan 2012
Location: Vellinge, Sweden
Posts: 6
Default Re: Insert comma after text

Hello

Thanks for the quick answers (jwhittaker and step)

The one liner from step worked perfect except that i need to put in the text "Fax" in front of the variable for Fax if they use it. Or else you can mistake Phone number and Fax.

Like this

040-22 33 44, 0733-33 44 55, Fax: 040-77 22 22

Best regards
Reply With Quote
  #12  
Old October 29th, 2012, 08:13 AM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 957
Default Re: Insert comma after text

Does the code that I wrote for dreimer not solve your problem?
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
  #13  
Old October 29th, 2012, 08:31 AM
spotless7325 spotless7325 is offline
Forum n00b
 
Join Date: Jan 2012
Location: Vellinge, Sweden
Posts: 6
Default Re: Insert comma after text

Hello

I just saw that.

It almost works (i removed the tags for phone and mobile and kept it for fax), but the rule puts in commas between all variables even if it is empty.

If i put in data in every variable it turns out like this
040-11 11 11, 0708-22 22 22, Fax: 040-33 33 33

If i put in data only in the Fax field it turns out like this
, , Fax: 040-33 33 33

Here are my slightly modified code

var contact = [[Field("Telefon")],[Field("Mobil")],["Fax:",Field("Fax")]];
var result = [];
for(var i=0; i<3; i++){
if (contact[i][1] != "") {
result.push(contact[i].join("&nbsp;"));
}

}

return result.join(",&nbsp;")




Best regards
Mattias
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 10:19 PM.


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