Textarea Manupulation to add tags

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    Textarea Manupulation to add tags

    So while typing reply, you will type the message in an editor...

    I need to make an editor similar to this one (reply editer), which can add [ b ],[ /b ] etc tags to the selected text onclick of the corresponding buttons...

    I tried lots of things...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What have you tried so far? If you want to apply styles, you may want to have a look at execCommand.

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Originally posted by acoder
      What have you tried so far? If you want to apply styles, you may want to have a look at execCommand.
      this is too complex... they are on the run adding HTML tags in one frame and generating corresponding HTML in the other.

      I just need to add few NON_HTML tags.
      I tried createRange() to get selected text and then replacing it with (startTag + selectedText + endTag), but it didn't work.

      I need to exactly like the editor here, but with just with B, I and U tags...

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        This page should help.

        Comment

        Working...