怎么用jquery创建form隐藏传值、post提交? 解决URL后参数过长的限制问题。以下demo,只改js 60
html:<ahref="javascript:;"class="btn-01sfndo-toApplyAll"onclick="toApplyAll()">批量申请</...
html:
<a href="javascript:;" class="btn-01s fndo-toApplyAll" onclick="toApplyAll()">批量申请</a>
<a href="javascript:;" class="btn-01s fndo-noApplyAll no" style="display:none;">批量申请</a>
js:
//批量申请
function toApplyAll(){
var code = new Array();
//var uids = $('input:checkbox.clsCheckSelect:checked');
var len = $('#fndo-noInvoiceList a.on').length;
if(len == 0){
error_ztip.setContentTpl("请选择要申请的记录!");
error_ztip.show();
return;
}
//拼接 所有被选中的ID
$('.sin-checkbox').each(function (){
var hasClass = $(this).hasClass('on');
if(hasClass){
//alert(this.id);
var vid = this.id;
var vid = vid.substring((vid.indexOf('_')+1),vid.length);
code[code.length] = vid;
}
});
var url = "/views/pply_info.html?id="+code;
//跳转置顶
//$(window.parent).scrollTop(0);
window.location.href = url;
//return false;
}
//试了下 input隐藏传值不起效果 展开
<a href="javascript:;" class="btn-01s fndo-toApplyAll" onclick="toApplyAll()">批量申请</a>
<a href="javascript:;" class="btn-01s fndo-noApplyAll no" style="display:none;">批量申请</a>
js:
//批量申请
function toApplyAll(){
var code = new Array();
//var uids = $('input:checkbox.clsCheckSelect:checked');
var len = $('#fndo-noInvoiceList a.on').length;
if(len == 0){
error_ztip.setContentTpl("请选择要申请的记录!");
error_ztip.show();
return;
}
//拼接 所有被选中的ID
$('.sin-checkbox').each(function (){
var hasClass = $(this).hasClass('on');
if(hasClass){
//alert(this.id);
var vid = this.id;
var vid = vid.substring((vid.indexOf('_')+1),vid.length);
code[code.length] = vid;
}
});
var url = "/views/pply_info.html?id="+code;
//跳转置顶
//$(window.parent).scrollTop(0);
window.location.href = url;
//return false;
}
//试了下 input隐藏传值不起效果 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询