function submitform(flag) {
if (flag == 1) {
jQuery("#productDTOListForm").attr("action", "buy.do?method=getProducts&type=good");
}
else if (flag == 2) {
jQuery("#productDTOListForm").attr("action", "storage.do?method=getProducts&type=good");
}
else if (flag == 3) {
var b = false;//是否有库存为0的商品
jQuery("input[name='productIds']").each(function() {
if (jQuery(this).attr("checked") == true) {
var id = jQuery(this).attr("id");
if (jQuery("#inventoryNum" + id).val() <= 0) {
b = true;
}
}
});
if (b) {
alert("库存小于等于0不能销售");
return;
}
else
jQuery("#productDTOListForm").attr("action", "sale.do?method=getProducts&type=good");
} else if (flag == 4) {
jQuery("#productDTOListForm").attr("action", "txn.do?method=getProducts");
}
else {
return;
}
jQuery("#productDTOListForm").submit();
}
?
详细解决方案
项目顶用到的JS
热度:268 发布时间:2012-11-03 10:57:44.0
相关解决方案