在投票的提交表单页面,修改提交属性函数为 οnsubmit=" return poll_checkbox_count_equ_maxchoices()"(在\template\default\forum\viewthread_poll.htm页面)
<form id="poll" name="poll" method="post" autocomplete="off" action="forum.php?mod=misc&action=votepoll&fid=$_G[fid]&tid=$_G[tid]&pollsubmit=yes{if $_GET[from]}&from=$_GET[from]{/if}&quickforward=yes" οnsubmit=" return poll_checkbox_count_equ_maxchoices()">
附poll_checkbox_count_equ_maxchoices()函数(在static\js\forum_viewthread.js文件添加)
function poll_checkbox_count_equ_maxchoices() {
//alert("最大项"+'"' + max_obj + '"'+" 共选择" + '"' + p + '"');
if ($('post_$post[pid]')) {
ajaxpost('poll', 'post_$post[pid]', 'post_$post[pid]');
return false
}
else {
if (p != (max_obj)) {
alert("所投总票数必须等于" + '"' + max_obj + '"');
return false;
}
else {
return true;
}
}
}