This is probably one for Rakuli as he has seen the JavaScript file in question.
I have a BBcode editor but there is no error trapping when checking if the form textarea is empty.
If I try and click one of the buttons for bold, italic etc without entering aything on the form I get the Error on Page in the bottom left corner and it points to line 29 with the message
Quote:
|
"window.document.editform.content.value is null or not an object"
|
Here is the function which causes the error
- Code: Select all
function tag(v, tagadd, newbut, tagclose, oldbut, name)
{
var r = document.selection.createRange().text;
rr = tagadd + r + tagclose;
if(r)
{
document.selection.createRange().text = rr;
}
else
{
if (eval(v)%2 == 0)
{
eval("window.document.editform."+name+".value = newbut;");
var content = window.document.editform.content.value;
window.document.editform.content.value = content + tagadd;
window.document.editform.content.focus();
}
else
{
eval("window.document.editform."+name+".value = oldbut;");
var content = window.document.editform.content.value;
window.document.editform.content.value = content + tagclose;
window.document.editform.content.focus();
}
eval(v+"++;");
}
}