Add to text in CuteEditor by clicking on a hyperlink outside the editor

Last post 03-05-2006, 2:42 PM by SGi. 6 replies.
Sort Posts: Previous Next
  •  03-03-2006, 7:44 AM 16650

    Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Hello all,
    I'm trying to update the contents of the CuteEditor with some text when I click a hyperlink (I'm not quite sure this is the best way to do this, as I'm just trying stuff out at the moment). With a normal text area, I can achieve what I want with:
     
    <script>
    function addtoeditor(comment) {
    document.form1.Reports.value = document.form1.Reports.value + comment;
    }
    </script>
    <form action="" method="get" name="form1">
    <textarea name="Reports" cols="50" rows="20"></textarea>
    <a href="#" onclick="addtoeditor('This has been added. ');">Click here to add something to the textarea</a>
    </form>
     
    How do I achieve this with a CuteEditor textarea (which is called editor.ID = "Report")?
     
    Many thanks,
    Steve.
  •  03-03-2006, 10:46 AM 16676 in reply to 16650

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Steve,
     
    The same code will work for CuteEditor as well.
     
     

    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

  •  03-03-2006, 11:48 AM 16685 in reply to 16676

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Hi Adam, thanks for the reply! 
    However, I'm not getting anything added to the editor when I click my hyperlink - it stays blank! The code I have for the page with CuteEditor on it is:
     
     
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="CuteEditor_Files/include_CuteEditor.asp" -->
    <head>
    <title>Test</title>
    </head>
    <script>
    function addtoeditor(comment) {
    document.form1.Reports.Value = document.form1.Reports.Value + comment;
    }
    </script>
    <body>
    <form action="" method="get" name="form1">
    <%       
           Dim editor
           Set editor = New CuteEditor  'Create a new editor class object         
             
           'Set the ID of this editor class
           editor.ID = "Reports"
             
           'Set the initial HTML value of editor control
           editor.Text = ""
           editor.FilesPath = "CuteEditor_Files"
           'editor.DisableItemList = "CSSClass, FormatBlock, FontName, FontSize"
                  
           editor.Template= "Bold,Italic,Underline"
           
           'editor.Width = 740
           'editor.Height = 100
           
           editor.ThemeType="Office2003"
           'editor.EditorWysiwygModeCss = "asp.css"
           editor.RemoveServerNamesFromUrl = true
           
           editor.Draw()
           
           ' Retrieve the data from editor: Request.Form("Editor1")
           %>
    <a href="#" onclick="addtoeditor('This has been added. ');">Click here to add something to the textarea</a>
    </form>
    </body>
    </html>
     
     
    Thanks,
    Steve.
  •  03-03-2006, 1:26 PM 16690 in reply to 16685

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Steve,
     
    change the following code:
     
    function addtoeditor(comment) {
    document.form1.Reports.Value = document.form1.Reports.Value + comment;
    }
     
    to:
     
    function addtoeditor(comment) {
    obj_Reports.SyncToHidden();
    document.form1.Reports.Value = document.form1.Reports.Value + comment;
    }
     
     
     

    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

  •  03-04-2006, 3:07 AM 16700 in reply to 16690

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Hi Adam, thanks again for the quick reply!
    Unfortunately, I still can't get the CuteEditor text area to update with the string I'm passing to the function.
     
    Steve.
  •  03-04-2006, 5:54 PM 16711 in reply to 16700

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Streve,
     
    Strange...
     
    Let us try another method:
     
    function addtoeditor(comment) {
        document.form1.Reports.Value = obj_Reports.getHTML() + comment;
    }
     
    Keep me posted
     
     
     
     

    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

  •  03-05-2006, 2:42 PM 16724 in reply to 16711

    Re: Add to text in CuteEditor by clicking on a hyperlink outside the editor

    Nope, still nothing. Sorry.
     
    Steve.
View as RSS news feed in XML