spotless7325
-
Posts
7 -
Joined
Posts posted by spotless7325
-
-
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
-
Hello
I have a problem regarding comma after text.
My client wants a comma after the telephone number if the variable field after telephone (which are Mobile in this case) are used and so on for the fax field.
I have a rule for inserting a comma, but this rule inserts a comma regardless if i writes or not in the next variable field.
I want something like this if all variables are used
"Phone 044-34 34 34, Mobile 0733-22 22 22, Fax 044-33 22 11"
And like this if only Phone are used
"Phone 044-34 34 34"
Best regards
Mattias
Insert comma after text
in The JavaScript Library
Posted
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[1] != "") {
result.push(contact.join(" "));
}
}
return result.join(", ")
Best regards
Mattias