function checkfm(form){
var uploadfile = form.logoFile.value;
if(uploadfile!=""){
var types = ["jpg","gif","bmp","png","exe","doc","pdf","txt","xls","ppt","swf"];
var ext = uploadfile.substring(uploadfile.length-3).toLowerCase();
var sing = false;
for(var i=0; i<types.length;i++){
if (ext==types[i]){
return true;
}
}
if(!sing){
alert("只允许上传图片/flash动画/word文件/exe文件/pdf文件/TxT文件/xls文件/ppt文件");
return false;
}
}
return true;
}
form action="product_brandService_add.action" method="post"
enctype="multipart/form-data" οnsubmit="return checkfm(this)">
产品品牌名称 :
<input type="text" id="12" name="brand.name" size="50" maxlength="50">
<br>
品牌图片 :
<input type="file" name="logoFile" size="80" maxlength="100">
<input type="submit" value="添加">
</form>