【发布时间】:2012-01-31 08:17:30
【问题描述】:
我正在开发一种用户可以根据需要添加行的表单。有一个名为“添加行”的链接,当它点击时,我想克隆一个隐藏表并更改它的名称值,一些类名。有人可以帮我解决这个问题吗?
<table class="montaj montaj-satir">
<tr>
<td width="62px"><input type="text" name="oper[--number--][kodu]" size="4" maxlength="4" /></td>
<td width="38px">
<input type="checkbox" name="oper[--number--][onay]" value="1" />
<input type="hidden" name="oper[--number--][terminal_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][soket_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][montaj_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][yon_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][push_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][olcu_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][bant_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][vida_hatasi]" value="0" />
<input type="hidden" name="oper[--number--][komponent_hatasi]" value="0" />
</td>
<td width="62px"><span class="terminal_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="terminal_hatasi--number--"> </a></td>
<td width="62px"><span class="soket_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="soket_hatasi--number--"> </a></td>
<td width="62px"><span class="montaj_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="montaj_hatasi--number--"> </a></td>
<td width="62px"><span class="yon_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="yon_hatasi--number--"> </a></td>
<td width="62px"><span class="push_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="push_hatasi--number--"> </a></td>
<td width="62px"><span class="olcu_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="olcu_hatasi--number--"> </a></td>
<td width="62px"><span class="bant_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="bant_hatasi--number--"> </a></td>
<td width="62px"><span class="vida_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="vida_hatasi--number--"> </a></td>
<td width="62px"><span class="komponent_hatasi--number--">0</span> <a href="#" class="add hata-ekle" id="komponent_hatasi--number--"> </a></td>
</tr>
<tr>
<td colspan="2">Kablo Sıra No</td>
<td colspan="4"><input type="text" name="oper[--number--][kablo_sira_no]" value="" /></td>
<td colspan="2">Açıklama</td>
<td colspan="3"><input type="text" name="oper[--number--][aciklama]" value="" /></td>
</tr>
</table>
具有.hata-ekle 类的链接,增加隐藏输入的值及其旁边的跨度。
如果需要新行,用户应点击“添加行”链接,新克隆的.montaj 表应出现,但--number-- 应替换为唯一编号。
我该怎么做?
谢谢...
【问题讨论】: