Solved

I need help badly here.

Posted on 2002-03-28
5
192 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

828 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