国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > DedeCMS > PHPCMS新增投票主题无法添加选项的解决办法

PHPCMS新增投票主题无法添加选项的解决办法

来源:程序员人生   发布时间:2014-05-22 17:53:09 阅读次数:3722次

在这个地方添加投票主题的时候点添加选项没有作用
管理地址类似于admin.php?mod=vote&file=vote&action=edit_subject&subjectid=2

点添加选项没有任何作用:

$(document).ready(function() {
$('#opt_template').hide();
$('#add_new').checkForm(1);
$('input[id^="add"]').click(function(){
var n=$(this).attr('optcount');
$(this).attr({optcount:(++n)});
var sid=$(this).attr('subjectid');
var newopt=$('#opt_template').clone(true);
newopt.attr({id:'newsopt1'}).find('span').text(n+'、');
newopt.find('input[id="pic"]').attr({id : 'pic'+n});
newopt.find('input[sn="99"]').attr( { sn : n } );
newopt.appendTo('#newsub'+sid).show();
});
$('input[id^="dec"]').click(function(){
var sid=$(this).attr('subjectid');
if($('#newsub'+sid).find('div:last').length<1) return false;
var ncount=$('input[subjectid="'+sid+'"][id^="add"]').attr('optcount')
$('input[subjectid="'+sid+'"][id^="add"]').attr({optcount:(ncount-1)});
//$(this).attr({optcount:(ncount-1)});
$('#newsub'+sid).find('div:last').remove();
});
//删除主题
$('#del').click(function(){
var n=$('input[tag="delsubject"][checked]').length;
if(n<1){
alert("没有选中任何选项");return false;
}
if(!confirm("真的删除吗?")) return false ;
$('#action').val('delete');
return true ;
});
//更新排序
$('#listorder').click(function(){
$('#action').val('edit_subject');
this.form.submit();
});
$('input[alter]').click(function(){
var v=$(this).val();
if(v=='0'){
$('#val').hide();
} else {
$('#val').show();
}
});
});

function addPic(index){
file_select('pic'+index, 0, 1);
}
function uploadpic(obj){
var id=$(obj).attr('sn');
openwinx('?mod=phpcms&file=upload&uploadtext=pic'+id,'upload','350','350');
}
<?php if(!empty($subjects)){ ?>$('tr[tag="hover"]').trhover();<?php } ?>

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------

上一篇 php页面 表单传递参数实例教程

下一篇 怎样利用论坛、博客去做高质量的外链

分享到:
------分隔线----------------------------
为码而活
积分:4237
15粉丝
7关注
栏目热点
关闭
程序员人生