dschiller Posted May 30, 2014 Share Posted May 30, 2014 Hi Everyone, so I'm having a little trouble applying a line break rule to a business card template that I've been working on. Basically I have a line of input, and I want my customers to be able to insert a semicolon (or other character) to break their lines where they please. Although I'm not the most fluent person in javascript, my code works when I validate, but when I click okay and apply it to my template, it neither works when I preview it or when I compose it. Currently, I have a rule stating: return TaggedDataField("Position").replace(/; /g, "\n"); So far, I've tried many variations of this code with the "Treat returned strings as tagged text" box checked and unchecked, yet the semicolon still remains after I click okay. I'm using FusionPro 9.2 right now if that helps, If anyone knows a workaround that would be wonderful! Thanks Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 30, 2014 Share Posted May 30, 2014 It's hard to say without knowing exactly what's in the data field. Also, are you sure you're actually calling out the rule, by the rule name, in a text frame, and not just the original field value? Quote Link to comment Share on other sites More sharing options...
dschiller Posted May 30, 2014 Author Share Posted May 30, 2014 It's hard to say without knowing exactly what's in the data field. Also, are you sure you're actually calling out the rule, by the rule name, in a text frame, and not just the original field value? Oops! I completely forgot to call out the rule. That solved everything! Thanks Quote Link to comment Share on other sites More sharing options...
dschiller Posted May 30, 2014 Author Share Posted May 30, 2014 Actually, as it turns out, I'm still getting the same problem even after replacing the data field in the text edit. Now whenever I preview, the semicolon disappears, but the line still isn't breaking. Is it possible that there's a problem with PTI handling escape sequences such as "\n"? I've tried using <br> but the system doesn't recognize it as a page break and just prints out "<br>" Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 30, 2014 Share Posted May 30, 2014 Now whenever I preview, the semicolon disappears, but the line still isn't breaking. Is it possible that there's a problem with PTI handling escape sequences such as "\n"? I've tried using <br> but the system doesn't recognize it as a page break and just prints out "<br>" Check the "Treat returned strings as tagged text" box in the Rule Editor, and the <br> tag will be handled properly in the output. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.