3 Replies Latest reply on May 8, 2008 11:19 PM by slaingod

    textarea

    thephantom6969
      Is there anyway to have different colors, fonttypes, bold, etc. in the text in a text area? I have done it with using the html tag, but it would seem logical that one should be able do this in a normal flex textarea.

      Thanks
        • 1. Re: textarea
          slaingod Level 1
          Not sure exactly what you mean, but textarea has an htmlText property that can work with a subset of html-ish tags. Otherwise, if you are talking about editing, then you should take a look at the RichTextEditor component.
          • 2. Re: textarea
            thephantom6969 Level 1
            Lets say I have some text in the text area. Can I change the color of one word in the text area or could I underline a word?
            • 3. Re: textarea
              slaingod Level 1
              You should be able to do that by setting the htmlText as mentioned. If you meant for the user to be allowed to edit the text, you would be better off using RichTExtEditor and hiding the control bars for instance, as I imagine as soon as the user edited the TextArea you might lose the underlines, tho I'm not sure.

              If for some reason you absolutely have to use TextArea, then you can probably accomplish what you want by detecting the change event on the TextArea and reapplying the formatting as needed.

              Say you are writing a word processor with dictionary underlining for misspelled words: You would allow the user to type their text, and then after each letter typed, you could look for changes and apply the underline as needed. But using RichTextEditor seems like it would be a lot easier.