FreeTextBox

The no. 1 free ASP.NET HTML Editor.
Welcome to FreeTextBox Sign in | Join | Help
in Search

Replacing content fragment within ftb text

Last post 09-26-2008, 5:57 PM by HIGHJACK. 2 replies.
Sort Posts: Previous Next
  •  09-26-2008, 11:55 AM 9485

    Replacing content fragment within ftb text

    Hello,

    I've got a textbox and i want the typed text to replace a portion of text in the ftbox. (Client side)

    I use a js function on the onchangeevent, i access a div through document.getElementsByName, and then i set the innerhtml property to the textbox content. But no refresh of the text in the ftb.

    Can anyone help ?

    Thanks

     

  •  09-26-2008, 12:30 PM 9487 in reply to 9485

    Re: Replacing content fragment within ftb text

    Try

    FTB_API[textBoxID].InsertHtml(your text);

    or if you want to replace all text:

    FTB_API[textBoxID].SetHtml(yourtext);

  •  09-26-2008, 5:57 PM 9489 in reply to 9487

    Re: Replacing content fragment within ftb text

    Yes but the InsertHtml add text at the caret position.. i want to make something like a "substr", even better, I placed a <div id="mydiv">TextToReplace</div> into the HTML of the ftb. I want to change the div content. is it possible, i use a getelementbyname

    Or if i can set the caret position from code :)

View as RSS news feed in XML
www.freetextbox.com