复选框ajax提交,Ajax调用复选框

我有两个复选框,现在单击其中一个复选框,我想对jsp页面进行ajax调用。该jsp页面将显示一个包含从数据库中获取数据的表。

现在,问题是说我有两个复选框,如:

Email Notification

File Sharing Notification

怎么办?请帮忙

My Script part :

$(document).ready(function () {

$('.search-select').on('change', function(){

$('.search-inputs').children().hide();

var classn =$(this).find(":selected").val();

//alert(classn);

if(classn=='searchName')

{

//alert("searchname");

$('.'+"searchName").show();

}

else if(classn=='searchType')

{

//alert("searchType");

$('.'+"searchType1").show();

$('.'+"searchtype1label").show();

$('.'+"searchType2").show();

$('.'+"searchtype2label").show();

}

else if(classn=='searchDate'){

//alert("searchType");

$('.'+"searchDateFrom").show();

$('.'+"searchDateTo").show();

$('.'+"Datesubmit").show();

}

});

$('#emailNotification').on('change',function() {

//var checked = $(this).is(':checked');

if(this.checked){

//alert("in");

$.ajax({

type: "POST",

url: "searchOnType.jsp",

data: {mydata: "emailNotification"},

success: function(data) {

alert('it worked');

$('#container').html(data);

},

error: function() {

alert('it broke');

},

complete: function() {

alert('it completed');

}

});

}

});

});

但是如何在同一页面上显示表格?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值