Inserting Into the Text Area with Javascript

Last post 11-29-2004, 6:47 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-29-2004, 5:52 PM 2683

    Inserting Into the Text Area with Javascript

    I have a custom image uploading tool that I developed for CE 3.0 (your's wouldn't write out to a UNC path), and am having a good bit of difficulty adapting it to 4.0. I can't seem to find the best way to insert html into the textarea using Javascript like I did before. What do I need to do to insert HTML into the editor?
     
    Also, by chance, is your tool able to write to UNC paths now? I haven't been able to locate any specific developer documentation on the site at all.
     
    Thanks!!
  •  11-29-2004, 6:47 PM 2689 in reply to 2683

    Re: Inserting Into the Text Area with Javascript

    johnkeithwood,

    Here is an example to create a custom botton and paste the html code into the editor:

    create a custom botton and paste the html code into the editor  
       //about Italic, see Full.config
       //<item type="image" name="Italic" imagename="Italic" />
       //get the pos after the Italic 

       int pos=Editor1.ToolControls.IndexOf("Italic")+1;

      
       //Themes/%ThemeName%/Images/text.gif
       WebControl ctrl=Editor1.CreateCommandButton("MyButton","text.gif","Insert My Custom Text");

       ctrl.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'hello world')";
      
       //add this custom button into the editor 
      Editor1.InsertToolControl(pos,"MyButton",ctrl);

     

     
    Please download the latest build which contains more document:

    How to's
    http://cutesoft.net/example/howto.aspx

    Developer's Guide
    http://cutesoft.net/developer+guide/index.html


    We realize that the document  is lagging behind, and we will included more instructions into the developer guide in this week.



     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML