• 动态添加input功能


    动态添加input功能:

    <script>     var TfileUploadNum=3; //记录图片选择框个数     var Tnum=3; //ajax上传图片时索引     function TAddFileUpload() {         var idnum1 = TfileUploadNum+1;         var idnum2 = TfileUploadNum+2;         var str="<div id='fileDataDiv[";         str+=idnum1;         str+="]' class='module_border'><div class='l'> 商品图片";         str+=idnum2;         str+=":</div><div class='c'><input id='fileData[";         str+=idnum1;         str+="]' name='fileData[";         str+=idnum1;         str+="]'  type='file' onchange='StatusValuesFunctiong(";         str+=idnum1;         str+=");'";         str+="class='input_border'/>";         str+="<input id='fileDataValue[";         str+=idnum1;         str+="]'  name='fileDataValue[";         str+=idnum1;         str+="]' type='text' style='330px;' readonly='readonly'/>";         str+="<input type='button' onclick='deleteDiv(";         str+=idnum1;         str+=");' value='删除'>";         str+="</div></div>";         $('#provincecode').append(str);         TfileUploadNum += 1;     }

        function deleteDiv(statusValue){         document.getElementById("fileDataDiv["+statusValue+"]").style.display='none';     } </script>

    <div id="provincecode" class="module_border">             <div id="fileDataDiv[0]" class="module_border">                 <div class="l">                     商品图片1:                 </div>                 <div class="c">                     <input id="fileData[0]" name="fileData[0]"  type="file" onchange="StatusValuesFunctiong(0);" value="1"/>                     <input id="fileDataValue[0]"  name="fileDataValue[0]" type="text" style="330px;" readonly="readonly"/>                     <input type="button" onclick="deleteDiv(0);" value="删除">                 </div>             </div>

     <input type="button" id="AddUpload" onclick="TAddFileUpload();" value="更多商品图片添加"/> </div>

  • 相关阅读:
    面向对象 课堂记录
    面向对象10个案例 (来源网络)
    面向对象举例
    面向对象
    36选7
    Android ImageView的scaleType属性与adjustViewBounds属性
    安卓计算器 简单代码
    安卓单选、复选按钮简单练习
    安卓发送邮箱界面 线形、表格、相对布局方式
    UI和View 三种控制方式
  • 原文地址:https://www.cnblogs.com/zifashaonian10000/p/4218340.html
Copyright © 2020-2023  润新知