sandigcustomprinters.com Posted March 31, 2011 Share Posted March 31, 2011 Template has a field(title) - customer inputs data for the field. A rule removes punctuation from the field(title). The results of this replace rule needs to become another field called field(title2). How do I input the value to field(title2) from the results of Rulereplacefield(title) var eq = Field("Title"); var filter = /([\?\#\&\*\s\(\)\.\,\-\\\/\n\r\t\"\'])/gi; var re = eq.replace(filter, ""); re = re.replace(/<br>/gi, ""); Field("titlehiddenforequickfill").content = re; Link to comment Share on other sites More sharing options...
Dan Korn Posted March 31, 2011 Share Posted March 31, 2011 The simplest way is just to make a standard Text rule (named "title2") which returns the value ("return re;"). Inserting the variable with that rule's name in the Variable Text Editor outputs the rule's value. If you give the rule the same name as a field ("title"), the rule's return value will override the data field's value when used in a text frame. If you need to use the rule's value in another rule, simply call the Rule() function instead of the Field() function. In FusionPro 7.1, there's a built-in function called RuleOrField() which will find either a rule or a field with the given name. You can also "inject" variables in OnRecordStart with the FusionPro.Composition.AddVariable() method, like so: FusionPro.Composition.AddVariable("title2", re"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.