删除复选框选中的数据,不管选中多少,传过去的值只有一个,请哪里的有关问题
程序员文章站
2024-01-13 16:01:16
...
删除复选框选中的数据,不管选中多少,传过去的值只有一个,请哪里的问题
<br> <table width="49%" cellspacing="1" bgcolor="#0093C4" id='demotable1'><br> <thead><br> <tr><br> <th width="3%"><INPUT name="chkAll" id="chkAll" title="全选" onClick="ChkAllClick('delivery[]','chkAll')" type="checkbox" /></th><br> <th width="8%" class="STYLE3">Item Code</th><br> <th width="12%" class="STYLE3">SKU</th><br> <th width="15%" class="STYLE3">ASIN</th><br> <th width="21%" class="STYLE3">Description</th><br> <th width="12%" class="STYLE3">Type</th><br> <th width="9%" class="STYLE3">Delivery Areas</th><br> <th width="10%" class="STYLE3">Account</th><br> <th width="10%" class="STYLE3">FNSKU</th><br> </tr><br> </thead><br> <tbody><br> <?PHP<br> while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {<br> ?><br> <tr><br> <td><input type="checkbox" name="delivery[]" value="<?PHP echo $row['id']; ?>" /></td><br> <td><?PHP echo $row['item_code'] ?></td><br> <td><?PHP echo $row['sku'] ?></td><br> <td><?PHP echo $row['asin'] ?></td><br> <br> <br>
<br> function delClick(){ <br> var val = $('input:checked').val(); <br> window.location.href="http://www.php1.cn/"> <br> } <br>
<br> <br> <input type="button" class="btn" id="add_btn" value="新 增" /><br> <br> <input name="button" type="button" class="btn" onclick="delClick()" value="删 除" /><br>
<br> case 'del' : //删除<br> <br> $id=$_GET["delivery"];<br> $SQL = "delete from `sku_rule` where id in($id)";<br> $result = mysql_query($SQL);<br> if (mysql_affected_rows($conn) != 1){<br> <br> echo "<script>alert('删除失败!');location.href="http://www.php1.cn/"> } else {<br> <br> echo "<script>alert('删除成功!');location.href="http://www.php1.cn/"> }<br> break;<br>