Hi,
I am facing a problem with Javascript.
I am working with content management system,
here an Admin can add a new content with text,images,etc..
while doing this i want to add a Text as hyperlink.
Example:
If we want to add a image then we will click the image button it brings a small popup window, there u can browse the image. The image url will be placed in a textbox, then the image will be place in the content once u have clicked the ok button.
This is sample javascript for the above example.
var elmLink;
var intAlignment;
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
var grngMaster = globalDoc.selection.createRange();
idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID
if (!txtFilevideo.fLinkLoaded)
{
grngMaster.execCommand("InsertImage", false, idstr);
elmLink = globalDoc.all['556e697175657e537472696e67'];
elmLink.removeAttribute("id");
elmLink.removeAttribute("src");
grngMaster.moveStart("character", -1);
}
elmLink.src = txtFilevideo.value;
similarly I want to click a image button it should bring a popup window, there I can browse the image.
The image url should be placed in one textbox and the Name of the Image should be typed in another textbox.
If I click ok button the Name should be placed inside the content as Hyperlink. If I click the hyperlink
it will open the image separately.
How the globalDoc.seletion.CreateRange() is working and what is the need of idstr.
I have tried a a lot with the above script, I don't know where I am struggling. Can anyone tell me how to full fill my requirement.
similar example scripts available here.
http://lists.adullact.net/pipermail/...er/005407.html
Cheers
Sankar