碧海潮声大学生网
标题:
〖原创〗〖pw_小hack〗提交按钮后自动禁用,以免重复发帖
[打印本页]
作者:
笨笨啊
时间:
2005-11-20 23:40
标题:
〖原创〗〖pw_小hack〗提交按钮后自动禁用,以免重复发帖
phpwind默认的可能会造成自动重复发帖的(双击提交按钮)
而现在看看我的站点?点击之后是会自动禁用的,直到提交完成
实现方法
修改文件:fastpost.htm
找到
function checkCnt() {
将这个函数修改为
function checkCnt() {
this.document.FORM.Submit.disabled="disabled";
this.document.FORM.Submit.value="正在提交中……";
this.document.FORM.submit();
return true;
/*cnt++;
if (cnt==1) return true;
alert('Submission Processing. Please Wait');
return false;
*/
}
复制代码
找到
if((event.ctrlKey && window.event.keyCode == 13)||(event.altKey && window.event.keyCode == 83))
{
this.document.FORM.submit();
}
复制代码
修改为
if((event.ctrlKey && window.event.keyCode == 13)||(event.altKey && window.event.keyCode == 83))
{
AddBaoZi();
this.document.FORM.Submit.disabled="disabled";
this.document.FORM.Submit.value="正在提交中……";
this.document.FORM.submit();
}
复制代码
post.htm里的修改方法类似,只要在
同样是替换前面的那个函数为
function checkCnt() {
this.document.FORM.Submit.disabled="disabled";
this.document.FORM.Submit.value="正在提交中……";
this.document.FORM.submit();
return true;
/* cnt++;
if (cnt==1) return true;
alert('正在提交中,请稍等…………');
return false;
*/
}
复制代码
就行了
这样就解决了有时点击提交按钮过快而导致的发两者或重复发帖现象了
作者:
小懒车
时间:
2005-11-21 11:22
嗯 ,好啊!`
收藏了
作者:
笨笨啊
时间:
2005-11-21 12:47
这个功能其实在很多别的地方也用不得,不一定非要这个论坛
作者:
LovGate
时间:
2005-11-24 21:44
这个我要了
谢谢楼主啊
不过我还没有做 成功
不知道怎么回事
作者:
笨笨啊
时间:
2005-11-24 21:46
…………本地多调试调试就行了
欢迎光临 碧海潮声大学生网 (http://www.zjoubbs.com/)
Powered by Discuz! X3.2