PDA

View Full Version : Bullet List


ksohayda
February 14th, 2011, 08:24 AM
Hi,

I'm trying to set-up a variable postcard with bulleted copy.
The bullets need to disappear if no copy is present in the field.
However, my field has to have hard returns as well? Please see attached PDF for visual.

I created two seperate varaible text boxes. One for the bullet and one for the varaiable field? Not sure if this is the way I should go? Also, I can't get the bullet to disappear. Not good at writing Javascript code. Here's a code I've been working on?

if (Field("Treatment Center1") == "")
return "";
else
return ' '+Field("Treatment Center1");

if (Field("Treatment Center2") == "")
return "";
else
return ' '+Field("Treatment Center2");
if (Field("Treatment Center3") == "")
return "";
else
return ' '+Field("Treatment Center3");
if (Field("Treatment Center4") == "")
return "";
else
return ' '+Field("Treatment Center3");


Anyone out there that can help or give advice as to what to do?

FreightTrain
March 30th, 2011, 11:37 AM
ksohayda,
Here is an easier way to accomplish your bullet list:
outstr = "";

for (item = 1; item < 9; item ++) //we are establishing the Loop where item loops thru each number less than 9

{
itemName = "Treatment Center" + FormatNumber("0", item); //our field is Treatment Center1-8 we are formatting it based on whatever item is

if (Len(Field(itemName)) > 0) //this is saying if the length is > 0 or could also be != ""

{
outstr += '<p>' +'&nbsp;&bull;&nbsp;' + Field(itemName);
}
}
outstr += "<p>";

return outstr;Make sure that you have the "Treat return strings as tagged text" check box checked for the Rule.

Hope this helps

Dan Korn
March 30th, 2011, 12:56 PM
You don't need a rule at all. You can do this in the Variable Text Editor: on each line, type the bullet character and insert the field name variable. Then do a "Select All" (Ctrl-A), click the "Paragraph" button, check the "Suppress if" box, and change the drop-down to "Containing Empty Variables."

dcb_creative
July 27th, 2011, 02:38 PM
Does this only work with a bullet character? I just tried it with a "" character and it didn't work. Any help with that??

Dan Korn
July 28th, 2011, 01:55 PM
Does this only work with a bullet character? I just tried it with a "" character and it didn't work. Any help with that??
Change line 11 to:
outstr += '<p>' +'&nbsp;&rArr;&nbsp;' + Field(itemName);