<IMG onclick=bbcode(document.formname,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b"> 
 

解决方案 »

  1.   

    关键是this.form不能在图片上用
      

  2.   

    是不是你图片名字错了:我这里可以啊:<style type="text/css">
    <!--
    .style3 {background: url(http://lucky.myrice.com/images/copyright.gif); border: 0px; width: 22px; height: 22px}
    .style4 {background: url(http://lucky.myrice.com/images/copyright.gif); border: 0px ; width: 22px; height: 22px}
    -->
    </style> 
    <input class="style3" type="button" value=" B " onclick="bbcode(this.form,'B','')" onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b">
    <input class="style4" type="button" value=" I " onclick="bbcode(this.form,'I','')" onmouseover="stat('i')" title="ITALIC (alt+i)" accesskey="i">
      

  3.   

    <input type=image src=edit.gif onclick="alert('图片做按钮,It is OK')">
      

  4.   

    我试了<IMG onclick="bbcode(this.form,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b">是可以的啊,不会是因为你的onclick敲掉了"吧
      

  5.   

    图片名字没有错阿
    你可以?
    为什么我这里不可以?
    见鬼了
    你说this.form不能在图片上用,那我该怎么用啊?
    function bbcode(theform,bbcode,prompttext) {
    if ((normalmode(theform)) || (bbcode=="IMG")) {
    if (text) { var dtext=text; } else { var dtext=prompttext; }
    inserttext = prompt(tag_prompt+"\n["+bbcode+"]xxx[/"+bbcode+"]",dtext);
    if ((inserttext != null) && (inserttext != ""))
    AddTxt = "["+bbcode+"]"+inserttext+"[/"+bbcode+"] ";
    AddText(AddTxt,theform);

    }
    else {
    donotinsert = false;
    for (i = 0; i < tags.length; i++) {
    if (tags[i] == bbcode)
    donotinsert = true;
    }
    if (donotinsert)
    stat("already_open");
    else {
    theform.message.value += "["+bbcode+"]";
    arraypush(tags,bbcode);
    }
    }
    theform.message.focus();
    }
      

  6.   

    to :weidegong(weidegong) 
    你的方法确实可行,但是也有个问题,原来botton的属性没有了,提交bbcode的同时,会将帖子一同提交。

    好烦阿
      

  7.   

    这样:  <IMG onclick=bbcode(document.formname,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b"> 
      

  8.   

    to net_lover
    <IMG onclick=bbcode"(document.formname,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b">
    onclick 属性无效
      

  9.   

    没有输入阿,我都是copy&paste的。