多文件上传界面的删除操作
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
var file1 = "1:ppt,22:ppt,33:ppt";
$(document).ready(function(){
$("button").click(function(){
$("li").each(function(){
});
$('input[name="chk"]:checked').each(function(){
var file = file1 ;
var files = file.split(",");
console.log( "files [i]:" )
console.log( files )
for(var i=0;i<files.length;i++) {
var info = files[i].split(":");
if(info[0]==$(this).val()){
console.log( "选中的:" )
console.log( $(this).val() )
files.splice(i,1);
file1 = files.join(',');
break;
}
}
});
});
});
</script>
</head>
<body>
<button>输出每个列表项的值</button>
<ul>
<li>Coffee</li>
<li>Milk</li>
<li>Soda</li>
</ul>
<input type="checkbox" name="chk" value="1">
<input type="checkbox" name="chk" value="22">
<input type="checkbox" name="chk" value="33">
<form id="zsfaForm" name="zsfaForm" method="post" enctype="multipart/form-data">
<input type="hidden" id="fileInfo" name="fileInfo" value=""/>
<input type="text" id="fileInfo" name="fileInfo" value=""/>
<input type="submit" id="1" name="1" value="提交"/>
</form>
</body>
</html>