What i'm trying to do is select an image and insert a link through one of my custom buttons.
Here's the button click event.
function button_click()
{
link = document.getElementById('selected_file').innerHTML;
editor1 = Window_GetDialogArguments(window);
var editor = Window_GetDialogArguments(window);
var folderName = getQuerystring('directory') + "/";
var pid = <?php echo $propertyId ?>;
var selected_html = getSelectedHTML();
final_text = "<a href=\"#\" onclick = \"BLOCKED SCRIPTdata_room('../sites/" + folderName + link + "?propertyid=" + pid + "')\">" + selected_html + "</a>";
if(selected_html != "" && link != ""){
editor.PasteHTML(final_text);
}
window.top.close();
}
getSelectedHTML function returns the selected html. No problems there. I checked it using alert box. Working perfectly in Firefox and Chrome. In IE8, instead of replacing the selected html it is creating new html specified in final_text variable and keeps the old html also. Please post any solution soon or are we seen a bug in Cute Editor (using the PHP Html Editor).