Hi Adam,
Yes I know its an old thread I'm upgreading from 5.3 to 6.4 and I want to use InsertImage dialog to retreve an Image and save the path of the image in my db.
I checked example demonstrates how to use CuteEditor as an image selector, It works fine but I need to save the image path from the textbox without the server link I tryed to disable that in the editor properities but no use because in th javascript you are filling the textbox text from the image src and in the img.src the full path i written so I have to reach the url from the <img> tag dialog..
<asp:TextBox id="txtURL" CssClass="TextBox" Width="90%" runat="server" />
<INPUT type="button" value="Change Image" onclick="callInsertImage()" id="Change" runat="server" NAME="Change">
<CE:Editor id="Editor1" runat="server" Width="400" Height="300" AutoConfigure="None" ShowPreviewMode="False" EnableContextMenu="false" BackColor="White" BorderColor="White" UseStandardDialog="True" RemoveServerNamesFromUrl="false" UseRelativeLinks="false" URLType="Absolute"></CE:Editor><br>
.
.
.
.
.
<script language="javascript">
<!--
if (document.getElementById("hdnSave").value == "1")
AddNewGallery();
function callInsertImage()
{
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
editor1.FocusDocument();
var editdoc = editor1.GetDocument();
editor1.ExecCommand('new');
editor1.ExecCommand('InsertImage');
InputURL();
}
function InputURL()
{
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
var editdoc = editor1.GetDocument();
var imgs = editdoc.images;
if(imgs.length>0)
{ document.getElementById("txtURL").value = imgs[imgs.length-1].src;
document.getElementById("txtURL").focus();
}
else
{
setTimeout(InputURL,500);
}
}
</script>