如何使用 php jquery 过滤带有复选框的内容...当我通过 jquery 发布表单时,我收到警告未定义索引
这是我的js文件
function filterContent(){
var all = $(".all").val();
$('input.all').change(function(){
$.post("filterall.php", {name: all}, function(data){
alert(data);
});
});
}
代码
<table class="table">
<tr>
<td><label class="margin pull-left">All</label><input type="checkbox" value ="all" name="all" class="all"></td>
<td><label class="margin pull-left">jquery</label><input type="checkbox" name="jquery"></td>
<td>
<label class="margin pull-left">HTML</label>
<input type="checkbox" name="html"></td>
<td>
<td><label class="margin pull-left">Javascript</label>
<input type="checkbox" name="javascript"></td></td>
<td><label class="margin pull-left">Php</label><input type="checkbox" name="html"></td>
<td><label class="margin pull-left">Java</label><input type="checkbox" name="java"></td>
</tr>
</table>
PHP代码
<?php
include 'connection.php';
if(isset($_GET['all'])){
$all = $_POST['all'];
echo "hello".$all;
}
?>