var newForm = $("#componentForm").clone().removeAttr("style").attr("id","componentForm"+count);
var newFormHtml = newForm.html().replace(/componentPrice\[0\]/g,"componentPrice["+count+"]");
newFormHtml = newFormHtml.replace(/componentPriceMoney0/g,"componentPriceMoney"+count);
newFormHtml = newFormHtml.replace(/total0/g,"total"+count);
newFormHtml = newFormHtml.replace(/0/g,count);
newFormHtml = newFormHtml.replace(/材料費\(1\)/g,"維修費("+(labelCount+1)+")");
newForm.html(newFormHtml);
newForm.find(".del").show();
newForm.find('#price_label').text('費用');
newForm.find('#price_label').next().children('.money').attr('placeholder', '請輸入維修費用');
newForm.find('.price-type').val('維修費');
$("#componentFormDiv").append(newForm);
$("#componentPriceMoney"+count).parent().find("span").html("");
$("#total"+count).html("");
count++;
labelCount++;
js表單克隆
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
輸入框填寫提示
$(document).ready(function() { $("#titlename").focus(function(){ if($(this).val() == this
如是我闻hjy
2020-06-22 16:38:38
js一對多,添加屬性
<tr> <td height="24" class="bline"> <table width="900" border="0" cellspacing="0" cellpaddi
如是我闻hjy
2020-06-22 16:38:38
jQuery在父頁面得到<iframe>引用子…
"jquery-1.3.1.js" type="text/javascript"> "text/javascript"> //查找匹配元素內部所有的子節點(包括文本節點),如果元素是一個if
寂寞烟
2020-06-16 02:40:27
jquery Ajax
寂寞烟
2020-06-16 02:40:27
頁面中文傳值,出現亂碼
坏孩子zj
2020-02-26 05:28:33
js 打開本地或共享文件夾
坏孩子zj
2020-02-26 05:28:33
擴展jQuery的功能限制只能輸入數字
tangkenyi
2020-02-25 23:22:16
js 不能直接將 console.log 作爲參數使用
tangkenyi
2020-02-25 23:22:16
EasyUI combobox 使用
tangkenyi
2020-02-25 23:22:16
前端打包構建工具gulp入門實戰
IT小君
2020-02-25 10:07:19
關於Javascript setTimeout中的this問題,以及倒計時器的實現源碼
IT小君
2020-02-25 10:07:09
整理好的省市區json數據
IT小君
2020-02-25 10:07:08