关于按钮的问题 <IMG onclick=bbcode(document.formname,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 关键是this.form不能在图片上用 是不是你图片名字错了:我这里可以啊:<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"> <input type=image src=edit.gif onclick="alert('图片做按钮,It is OK')"> 我试了<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敲掉了"吧 图片名字没有错阿你可以?为什么我这里不可以?见鬼了你说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();} to :weidegong(weidegong) 你的方法确实可行,但是也有个问题,原来botton的属性没有了,提交bbcode的同时,会将帖子一同提交。哎好烦阿 这样: <IMG onclick=bbcode(document.formname,'B','')" height=22 alt=bold src=bold.gif width=23 onmouseover="stat('b')" title="BOLD (alt+b)" accesskey="b"> 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 属性无效 没有输入阿,我都是copy&paste的。 求助ie 错误 syntax error 改动一段js代码 关于checkbox赋值问题 如何替换 问个正则问题!关于英文和中文字节数的!求大神指导~~~ 关于javascript 禁用鼠标左键的javascript代码 代码改动,滚动文字 关于树形菜单的问题 源码与js问题(求大佬) 当我点击页面中间的内容时。如何让页面的滚动条保持不动?100分求答案。 请问在javascript中如何判断输入框中输入的是否为整数?
<!--
.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">
你可以?
为什么我这里不可以?
见鬼了
你说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();
}
你的方法确实可行,但是也有个问题,原来botton的属性没有了,提交bbcode的同时,会将帖子一同提交。
哎
好烦阿
<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 属性无效