Hi,
With the following javascript, is it possible to make it so when you click the button to place the bbcode in the text area, have the cursor start between the tags?
[code]function bbcode(open, end){
var tArea = document.addcars.description;
var isIE = (document.all)? true : false;
var open = (open)? open : “”;
var end = (end)? end : “”;
if(isIE){
tArea.focus();
var curSelect = document.selection.createRange();
if(arguments[2]){
curSelect.text = open + arguments[2] + “]” + curSelect.text + end;
}else{
curSelect.text = open + curSelect.text + end;
}
}else if(!isIE && typeof tArea.selectionStart != “undefined”){
var selStart = tArea.value.substr(0, tArea.selectionStart);
var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
var curSelection = tArea.value.replace(selStart, ”).replace(selEnd, ”);
if(arguments[2]){
tArea.value = selStart + open + arguments[2] + “]” + curSelection + end + selEnd;
}else{
tArea.value = selStart + open + curSelection + end + selEnd;
}
}else{
tArea.value += (arguments[2])? open + arguments[2] + “]” + end : open + end;
}
}
THanks