Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

How can I replace a series of tags in text?

$
0
0

I am using LiveCycle Designer 10.4 in the SAP environment to create PDF customer quotes. All data is fed into my layout from the SAP system.

 

Some of the legal text has variables that are automatically populated by the quoting system. The text is fed into my layout with the variables called out by bracketed tags. My mission is to remove the bracketed tags so they do not display in the output that goes to the customer. For example, in the image below, I want the [V1], [/V1], [V2], and [/V2] to be removed.

sample_tags.gif

 

I have tried both JavaScript and FormCalc to no avail on the initialize and exit events.

 

Example code that didn't work is below.

 

FormCalc

$.rawValue = Replace($.rawValue, "[V1]', "")

This script did not find the tag. And even if it did, I'm not sure how to make it loop and find the next tag.

 

JavaScript

var textWithTags = data.Page1.sub_QuoteTexts.TPAtext.rawValue;

var textNoTags = textWithTags.replace("[V1]", "");

var textNoTags = textNoTags.replace("[/V1]", "");

var textNoTags = textNoTags.replace("[V2]", "");

var textNoTags = textNoTags.replace("[/V2]", "");

data.Page1.sub_QuoteTexts.TPAtext.rawValue = textNoTags;

 

This JavaScript did work when I set it up in a little HTML page, but not when I ported it into my layout in Designer.

 

Any help would be very much appreciated.

 

Thanks!


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>