我是靠谱客的博主 贤惠衬衫,这篇文章主要介绍关于js动态添加上传文件框,现在分享给大家,希望可以做个参考。

主要的js方法如下:

function addRow(){

    var input = document.createElement('input');

    input.setAttribute("type","file");

    input.setAttribute("size","55");

    input.setAttribute("name","theFile");

    $("#theFile").after(input);

    $("#theFile").after(document.createElement("BR"));

}


jsp页面中的元素如下:

<TR>

  <th width="137" align="right"><strong>文件选择:</strong></tdh>

  <TD vAlign=top>

      <input name="theName" type="hidden" size="40">

      <input class="formInputText" name=theFile id="theFile" type=file size="60"  onpropertychange="MM_changeProp2(this.value)">

      <input type="button" id="filebtn" name="filebtn" class="formInputText" value="继续添加" οnclick="addRow()">

   </TD>

</TR>

效果图如下:

wkiom1qpyeswfdbtaabgdwh74cs373.jpg

转载于:https://blog.51cto.com/butcher36/1550496

最后

以上就是贤惠衬衫最近收集整理的关于关于js动态添加上传文件框的全部内容,更多相关关于js动态添加上传文件框内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(48)

评论列表共有 0 条评论

立即
投稿
返回
顶部