Hi all I am trying to use javascript to add a popup window so a user can add a link to there website (in iframe/design mode) after they have selected the text that they want to turn into a link. I am currently using the popup code:

function createURL() { 
	 var szURL=prompt("Enter a URL:", "http://");
	    if ((szURL != null) && (szURL != "")) {
	 Editor.execCommand("CreateLink",false,szURL);
		}
	 }

IE7 and IE8 show a message saying something about allowing it and i think this will scare the users. I am looking for a method that will popup a window and allow them to fill in the link details and if possible allow them to pick a (link) target.

basicly like http://tinymce.moxiecode.com/examples/full.php does. I have read something about the inserthtml function thats with javascript but im not sure if this is what is being used with tinymce. I am sure this is possible as they have done it using javascript.

Any help would be great thanks.

    I think that you should use the window methods of the window object. Alternatively you can use a hidden div layer that shows when needed.

      hi thanks for the reply but i think the hardest part of this is getting it to add the link to the correct text in the iframe? Also I think a hidden div is a good idea.

        Your iframe could be aware this is possible and accept the link via query string.

          Write a Reply...