Solved

I need help badly here.

Posted on 2002-03-28
5
191 Views
Last Modified: 2006-11-17
Hi,

This is a sample of code i got from http://msdn.microsoft.com/

<HTML>
<BODY>
<H1 unselectable="on">Creating a Link and Retrieving the URL</H1>
<script>
function AddLink()
{//Identify selected text
var sText = document.selection.createRange();
if (!sText==""){
    //Create link
     document.execCommand("CreateLink");
     //Replace text with URL
     if (sText.parentElement().tagName == "A"){
       sText.parentElement().innerText=sText.parentElement().href;
       document.execCommand("ForeColor","false","#FF0033");
     }    
  }
else{
    alert("Please select some blue text!");
  }  
}
</script>
<P unselectable="on">Select any portion of the following blue text, such as "My favorite Web site". Click the button to turn the selected text into a link. The text will be changed to the URL that you specify.</P>
<P style="color=#3366CC">My favorite Web site is worth clicking on. Don't forget to check out my favorite music group!</P>

<BUTTON onclick="AddLink()" unselectable="on">Click to add link</BUTTON>
</BODY>
</HTML>



I'm wondering, is there a way to customize the CreateLink dialog box? What I mean is, I don't want to use the default dialog box, instead I would like to use my own .. is it possible to do that?
0
Comment
Question by:hating_it
5 Comments
 
LVL 12

Expert Comment

by:lexxwern
ID: 6902064
i guess no; because the dialog box is generated by the browser and not the document; experts correct me if im wrong;

but you can ask your visitor to change skins;-)

lexxwern
0
 

Author Comment

by:hating_it
ID: 6909545
Hmmz ... i really do need some advice badly from all the experts out there ...
0
 
LVL 12

Accepted Solution

by:
lexxwern earned 70 total points
ID: 6918234
well; there are more questions asking similar things;

maybe you look there as this Q hsn't got that much attention; but im anyway quite sure that the answer in no.

lexxwern
0
 

Expert Comment

by:ComTech
ID: 6936920
Hello hating_it, I have added some points to your account should you wish to reopen another question, and gain the advice you are looking for.

Regards,
ComTech
CS Admin @ EE
0
 

Expert Comment

by:beebop
ID: 7228222
Yes, you can simply open a popup window and have a textbox in there and then run createlink in the opening document from the popup window
if you specify an url in the createlink function it will not open the dialog box but create a link directly
execcCommand("createLink","http://www.mysite.com")

Beebop
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question