Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every body,


I have an editor and i want to create link in it by Javascript like that:

I have a button that which fire Javascript method:

ASP.NET
<asp:Button ID="btnInsertLink" runat="server" Text="Get Link"  OnClientClick="GetLink();return false;" />


and i have iframe that which will be the TextArea:

HTML
<iframe id='myTextArea' name='iframe'  ></iframe>


and that is Javascript method:

JavaScript
function GetLink()
     {

         var vKeyWord = "http://www.codeproject.com";
         myTextArea.document.execCommand('createlink', 0 ,vKeyWord);

     }


but it not work with me.
Posted
Updated 7-Nov-11 9:28am
v4
Comments
Richard MacCutchan 7-Nov-11 5:08am    
but it not work with me.
What does this mean? If you need technical help then try and explain your problem in technical terms, saying it does not work gives no clues as to what your problem might be.
thatraja 7-Nov-11 7:14am    
Not clear, what are you trying?

1 solution

Is this what you are attempting to do? http://msdn.microsoft.com/en-us/library/ms536419(v=vs.85).aspx[^]
 
Share this answer
 
Comments
MrLonely_2 7-Nov-11 18:22pm    
Yes, it is exactly.
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900