< ? for(..)?>
< input type="checkbox" name="couponlist[]" value="couponId;?>" >
< ? }?>
Validation Script:
function validateRemove() {
var chk = document.getElementsByName('couponlist[]');
var len = chk.length;
var flag = 0;
for (i = 0; i < len; i++) {
if( chk[i].checked == true ){
flag = 1;
}
}
if(flag == 1) {
if(confirm('Are you sure you want to remove selected coupons')){
document.forms.couponlist.submit();
}
} else {
alert('Select atleast one coupon to remove');
return false;
}
}
No comments:
Post a Comment