张传龙 发表于 2013-1-29 08:48:14

项目中用到的JS

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").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();      }
页: [1]
查看完整版本: 项目中用到的JS