Hi,
I am using the following function to insert a link on selected text in a textarea
function formatTextLink (tag) {
var selectedText = document.selection.createRange().text;
if (selectedText != "") {
var newText = "<a href='" + tag + "'>" + selectedText + "</a>" ;
document.selection.createRange().text = newText;
}
}
onClick="formatTextLink('
This works great but ideally I would like to be able pre-specify the address in another textfield and then insert this address
any help would be greatly appreciated.
I am using the following function to insert a link on selected text in a textarea
function formatTextLink (tag) {
var selectedText = document.selection.createRange().text;
if (selectedText != "") {
var newText = "<a href='" + tag + "'>" + selectedText + "</a>" ;
document.selection.createRange().text = newText;
}
}
onClick="formatTextLink('
This works great but ideally I would like to be able pre-specify the address in another textfield and then insert this address
any help would be greatly appreciated.