更新/插入 商品信息

2016-07-07 15:02 来源:www.chinab4c.com 作者:ecshop专家

goods_info.htm中有这样一个form
<form enctype="multipart/form-data" action="" method="post" name="theForm" **ubmit="return validate();">
。。。。。
</form>
validate()函数如下
function validate()
{
var validator = new Validator('theForm');
validator.required('goods_name', goods_name_not_null);
if (document.forms['theForm'].elements['cat_id'].value == 0)
{
validator.addErrorMsg(goods_cat_not_null);
}
checkVolumeData("1",validator);
validator.required('shop_price', shop_price_not_null);
validator.isNumber('shop_price', shop_price_not_number, true);
validator.isNumber('market_price', market_price_not_number, false);
if (document.forms['theForm'].elements['is_promote'].checked)
{
validator.required('promote_start_date', promote_start_not_null);
validator.required('promote_end_date', promote_end_not_null);
validator.islt('promote_start_date', 'promote_end_date', promote_not_lt);

}
if (document.forms['theForm'].elements['goods_number'] != undefined)
{
validator.isInt('goods_number', goods_number_not_int, false);
validator.isInt('warn_number', warn_number_not_int, false);
}
return validator.passed();
}

请问这样一个form怎么产生post请求?
按结果来看产生了insert 或者是update的请求使得goods.php文件能够执行修改

回答:
解决了~~form中有一个input标签看漏了