日期:2014-05-19 浏览次数:20632 次
<script language="javascript" type="text/javascript"> function retur(){ return false; } function Formfield(name, label){ this.name=name; this.label=label; } function clearForm(name){ this.name=name; } function verifyForm(objForm){ var clearnull = new Array( new clearForm("name"),new clearForm("type"),new clearForm("baseprice"),new clearForm("marketprice"),new clearForm("sellprice"), new clearForm("stylename"),new clearForm("logoPath") ); for(var i=0;i<clearnull.length;i++){ var clearobj = eval("objForm."+ clearnull[i].name); if(trim(clearobj.value)!="" || trim(clearobj.value)!=0.0){ $("#"+clearnull[i].name).html(""); } } var list = new Array(new Formfield("name", "产品名称"),new Formfield("type", "产品类型"), new Formfield("baseprice", "产品底价"),new Formfield("marketprice", "产品市场价") ,new Formfield("sellprice", "产品销售价"),new Formfield("stylename", "产品图片的样式"),new Formfield("logoPath", "产品图片")); for(var i=0;i<list.length;i++){ var objfield = eval("objForm."+ list[i].name); if(trim(objfield.value)==""){ $("#"+list[i].name).html(list[i].label+ "不能为空"); if(objfield.type!="hidden" && objfield.focus()) objfield.focus(); return false; } } return true; } </script>