6 Replies Latest reply on Feb 20, 2007 10:18 AM by Newsgroup_User

    line breaks in dynamic text?

    Level 7
      I have some text that goes into a dynamic text box and I would like to
      break it. I would like to break it after the first sentence. I thought
      the <br> might do it, but it seems not like this?

      bodyCopy.errorText.text = "Username and password do not match.<br>Please
      re-enter your username and password.";


      Thank you!
        • 1. Re: line breaks in dynamic text?
          Level 7
          Brian,

          > I have some text that goes into a dynamic text box and I
          > would like to break it. I would like to break it after the
          > first sentence. I thought the <br> might do it, but it seems
          > not like this?

          Make sure your dynamic text field is set to a) Multiline and b) enabled
          for HTML.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: line breaks in dynamic text?
            Level 7
            David, thanks!

            I know have the html enabled, but it still treats the <br> as part of
            the text.

            This is what I have:
            bodyCopy.errorText.text = "Username and password do not match.<br>Please
            re-enter your username and password.";

            Thank you for the help!
            Brian


            • 3. Re: line breaks in dynamic text?
              Level 7
              Brian,

              > I know have the html enabled, but it still treats the <br> as
              > part of the text.

              Make sure the text field is also set as Multiline, rather than Single.

              > This is what I have:
              > bodyCopy.errorText.text = ...

              Woops, I missed that before. The TextField class (which defines dynamic
              and input text fields) provides two text-related properties: text and
              htmlText. When you're using HTML as your text, use the latter:

              bodyCopy.errorText.htmlText = "<p>tags here<br />and here</p>";


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: line breaks in dynamic text?
                Level 7
                I just followed the manual directly like this:

                bodyCopy.errorText.html = true;
                bodyCopy.errorText.multiline = true;
                bodyCopy.errorText.text = "Username and password do not match.<br
                />Please re-enter your username and password.";

                And still am having the problem. What could be the issue? I also set the
                text box to html enabled and multililne, could the two be conflicting?

                Thank you!



                • 5. Re: line breaks in dynamic text?
                  Level 7
                  Brian,

                  > I just followed the manual directly like this:
                  >
                  > bodyCopy.errorText.html = true;
                  > bodyCopy.errorText.multiline = true;
                  > bodyCopy.errorText.text = "Username and password do not match.<br />Please
                  > re-enter your username and password.";

                  That's almost right.

                  > And still am having the problem. What could be the issue?
                  > I also set the text box to html enabled and multililne, could
                  > the two be conflicting?

                  They're not conflicting, but you need to add your HTML text to the
                  object's htmlText property, not the text property.

                  bodyCopy.errorText.htmlText = // tags here


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Re: line breaks in dynamic text?
                    Level 7

                    David,
                    great, got it working. Sorry, did not see your response before posting
                    my second one. But it is all working now!

                    Thanks a lot!!!
                    B