php投票选项不出来,PHPCMS新增投票主题无法添加选项的解决办法

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

2020-11-04

编程之家收集整理的这篇文章主要介绍了PHPCMS新增投票主题无法添加选项的解决办法,编程之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在这个地方添加投票主题的时候点添加选项没有作用

管理地址类似于admin.PHP?mod=vote&file=vote&action=edit_subject&subjectid=2

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

<a%20href=Dedecms/PHPky/$(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();

}

});

替换为:

$(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,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 } ?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值