Re: Select image with ExecCommand('insertimage') and write path to textbox

  •  05-19-2008, 4:38 PM

    Re: Select image with ExecCommand('insertimage') and write path to textbox

    mlc962,

    Please check the following example:

    How to use CuteEditor as an image selector?
    How to use CuteEditor as an image selector?( Demo1 |  Demo2 )
    This example


    The source code of this example can be found in the download package.
     
    <Script Language="javascript">
        function callInsertImage() 
        { 
       var editor2 = document.getElementById('<%=editor2.ClientID%>');
                editor2.FocusDocument(); 
                var editdoc = editor2.GetDocument(); 
                editor2.ExecCommand('new');
                editor2.ExecCommand('ImageGalleryByBrowsing');
                InputURL();
        }   
       
        function InputURL()
        {
      var editor2 = document.getElementById('<%=editor2.ClientID%>');
            var editdoc = editor2.GetDocument(); 
            var imgs = editdoc.images;
            if(imgs.length>0) 
            { document.getElementById("imageFld").value = imgs[imgs.length-1].src;
                editor2.ExecCommand('new');
                document.getElementById("imageFld").focus();
            } 
            else
            {
       setTimeout(InputURL,500);
            } 
        }      
    </script>
     

    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 Complete Thread