【发布时间】:2014-02-08 11:34:46
【问题描述】:
我有 html 表,当单击按钮时我有按钮重定向到下一页并显示与传递的数据有关的值,但我希望如果表中的任何复选框被选中,它不会重定向到下一页它只会重定向当表格中的所有复选框都未选中时,我尝试了但它不起作用,任何人都可以指导我。
ajax
<script>
$(document).ready(function() {
$("#redirect").click(function() {
var chkBox=document.getElementById("checkAddress").value;
if (chkBox.checked == 0)
{
var clientid=document.getElementById("client").value;
$.blockUI(
{
message: '<h2>Please wait...</h2><img src="/image/loader.gif" />',
timeout: 2000
});
$.ajax({
type:"post",
data:"clientid="+clientid,
success:function(data){
window.location = '?action=redirectclientpricenotification&clientid='+clientid+'';
$("#result").html(data);
$('.blockUI').hide();
}
});
}
else{
alert("chkBox");
}
});
});
</script>
html
<th ><img id='redirect' src="/image/exporttt.png" style="margin:-30 0 0 0px;cursor:pointer;" >
</th>
<td id="CPH_GridView1_Status1'.$rows['net_id'].'" class="updateseleniumroute status1 '.$rows["net_id"].' "><input type="checkbox" style="margin:0 0 0 93px;" id="checkAddress" name="checkAddress" '.$checked_value.' ></td>
【问题讨论】: