node.js实现多图片上传实例(4)

var name;
            name=path.split('\\');
            var bb=name[name.length-1];            
            //alert(bb.substr(0,bb.indexOf('.')));  //AddFile 结果

$(obj).parent().children().eq(0).css('fontSize','12px');
            $(obj).parent().css('borderStyle','solid');
            $(obj).parent().children().eq(0).html(bb.substr(0,bb.indexOf('.')));
            if($(obj).parent().attr('index')==1){//新增
                var html = '<div index="1"><span>+</span><input type="file" onchange="ADD.upload_change(this)" /></div>';
                $('#upload_box').append(html);
                $(obj).parent().attr('index','0');
            }
        }
     };
</script>
<form method="post" action="/add" enctype="multipart/form-data">
    <table>
        <tr>
            <td>经度:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>维度:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>分类:</td><td><select><option value="1">分类1</option></select></td>
        </tr>
        <tr>
            <td>地址:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>标题:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>简介:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>内容:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>图片:</td><td><div index="0"><span>+</span><input type="file" onchange="ADD.upload_change(this)" /></div><div index="1"><span>+</span><input type="file" onchange="ADD.upload_change(this)" /></div></td>
        </tr>
        <tr>
            <td>价格:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td>标签:</td><td><input type="text" /></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="提交" /></td>
        </tr>
    </table>
</form>


 

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgpjdy.html