[js]
theform is null ->
theform.message.value += "["+imgcode+"]"+inserttext+"[/"+imgcode+"] ";
[/js]
kod html:
<input type="button" class="button" value="IMG" style="width: 38px; text-indent: -2px;" onclick="imgcode(this.form,'img','http://')" />
a to kod JS odpowiadający za dodanie BBCode IMG:
[js]
var img_addr = '';
function imgcode(theform,imgcode,prompttext)
{
tag_prompt = img_addr;
inserttext = prompt(tag_prompt+"\n["+imgcode+"]xxx[/"+imgcode+"]",prompttext);
if ((inserttext != null) && (inserttext != ""))
theform.message.value += "["+imgcode+"]"+inserttext+"[/"+imgcode+"] ";
theform.message.focus();
}
[/js]
Ogólnie jest to fragment BBCode z phpBB2. Wyświetla okienko i trzeba wpisać URL aby dodać obrazek IMG.
Skąd ten błąd?