Inserting an optional bullet or character between 2 fields in ezMerge Follow
On a card where you have multiple pieces of information that are optional but need to be separated by bullets no matter what is chosen use this script.
For instance, if you have: Telephone • Cell • Fax
With the normal method a bullet must either follow Telephone or come before Cell, this is a more advanced method prevents that.
This knowledge base article assumes you have a very good understanding of how ezMerge Templates work with Job Forms.
Image-A
To automatically place a character between 2 values, follow the directions below.
- You'll need to add a Script field to your Job Form.
Image - B - Name the Script field something logical like "BulletPointAdder". The customer will not see this name.
- You must have a PDFlib textline block on your PDF that will hold the special character. In this example, we name the PDFLib textline block "Bullet". Make sure to mark the field as "hidden" on your ezMerge template. This field will need to be put in the place of the normal bullet point in your textflow so that it appears on the template. Keep in mind the style of this bullet point is controlled by the textline options, similar to any other field.
Image - C - In the Script below you'll see references such as "udf_BusCard\\:Bullet". The "udf_BusCard" portion comes from the field name on your Job Form. See Image B above. The "Bullet" portion comes from the name of the field on the ezMerge template. See Image C above. Both of those names will need to be updated depending on the field names you use on your Job Form and ezMerge Template.
- The script checks to make sure that both values are present before inserting the desired character between them. In the example below, it puts a bullet (\u2022) in between the 2 values. If the proof uses something different, for instance a slash, you can just replace \u2022 with a "/" (without the quotes).
-
<script type="text/javascript">
<!--
$(document).ready(function(){
function CopyText() {
if ($('#udf_BusCard\\:Tell').val() != '' && $('#udf_BusCard\\:Cell').val() != '')
$('#udf_BusCard\\:Bullet').val('\u2022');
else
$('#udf_BusCard\\:Bullet').val('');
}
$('#udf_BusCard\\:Tell').bind('change', function(e) { CopyText(); });
$('#udf_BusCard\\:Cell').bind('change', function(e) { CopyText(); });
CopyText();
});
-->
</script>
Need something different than a bullet point?
Use this table to find the character you need and replace u2022 in the code above with the corresponding code you find in the link.
http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec