LOL...
Ok...I have found a nice code here...
Currently I am using this code to make the selected text to be a hyperlink
'+AnyWebAddress+'
This works well if the user enter any address without the
http:// header!
If the user enter the web address including the
"http://" header,
the link will not be working since there will be two
"http://" header inside the link!
I have tried to use the <url> method but it is not working..
<url=\""+txt+"\">"+txt2+"</url> --> code from webforumz
When I type [url] followed by the web address, the output will show the "[]" in my display page.
and I tried to type <url> instead but the link is not active in my display page..
I wonder how webforumz uses the [url] method?
we can just type any web address enclosed with the [url], and then if works! But when I tried inside my textarea, it didn't work:mad:
Can anybody tell me whats wrong with my code?
I dont understand how the <url> method works...???
This is the code that I am using now...
- Code: Select all
function hiliteToExternLink(txtArea){
txtAreaName = txtArea.name;
txtRange = document.all[txtArea].createTextRange();
txtContainer = txtRange.parentElement().name;
objRange = document.selection.createRange();
hiliteTxt = objRange.text;
toExternLink = '' + hiliteTxt + '';
if(hiliteTxt != ""){
objRange.text = toExternLink;
}
}