使用ajax发布复选框值
答
穿上复选框onclick事件:
3210,并作出这样一个功能:
function postwithajax(e){
//and here send with ajax e.checked
}
答
使用jQuery从HTML获取值
$("#submit").click(function(){
var myarray = [];
$("#div input:checked").each(function() {
myarray.push($(this).val()); //push each val into the array
});
// here post Array with ajax
});
的Html
<html>
<head>
</head>
<body>
<div id="div">
<input type="checkbox" value="one_name" checked>
<input type="checkbox" value="one_name1">
<input type="checkbox" value="one_name2">
<input type="button" value="submit" id="submit">
</div>
<textarea id="t"></textarea>
</body>
</html>
先看看这篇文章,我想你可以适应你。 http://*.com/questions/4816145/how-to-detect-that-a-user-has-unchecked-a-checkbox ---如果你只是需要在屏幕上打印其他东西,连接链接上面,将更改为 ..我认为会为你工作。 – B4NZ41 2011-01-27 12:35:05
jQuery是一个选项吗? – 2011-01-27 12:36:27