These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Finding carraige returns in Replace function

RichLorn
Registered: May 19 2008
Posts: 46
Answered

textfield1 accepts user entry of 2 lines of text, that is then copied to textfield2, which displays that text as a long single line. When text is entered as a continuous phrase in textfield1, allowing wordwrap to advance to the second line, textfield2 displays ok. But if the user prematurely advances to the second line of textfield1 by using the enter key, a carraige return is included in the text displayed by textfield2, and the second line drops below and is not visible.
 
I'm trying to remove the carraige return in a calculation event script on textfield2. I've tried all the variations of the Replace function I can think of, all with no success: Replace($, "U000D", " ")
I've also tried U+000D, U+oooD, UoooD, #xD, using Space(1) in place of " ", using the full SOM instead of $, adding the escape character \, removing quotes around the carraige return code (syntax error), etc etc. I need help.

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Accepted Answer
Hi,

your were very close to the solution.
When I use this FormCalc in the exit:Event my form behaves as you described.

  1. var brk = "\u000d"
  2. Textfield2.rawValue = Replace($, brk, " ")

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

RichLorn
Registered: May 19 2008
Posts: 46
You make it look so easy Radzmar. I wish Adobe would hire you to rewrite the FormCalc User Reference Publ.
Thanks again. And congratulations on your upcoming 1000th post. :)