日期:2014-05-16  浏览次数:20352 次

动态增加文本框时 获取同页面input 并显示在 增加的input中
本帖最后由 u014060578 于 2014-03-12 16:39:13 编辑
目的 :动态增加upc 和  memberSn同时要获取 同页面delStorageInventoryIn[0].upc 和delStorageInventoryIn[0].memberSn
的值 

//html 代码
<td colspan="7">
<input type="text" name="delStorageInventoryIn[0].upc" class="text" maxlength="20" /> 
</td>

<td colspan="7">
<input type="text" name="delStorageInventoryIn[0].sn"class="text" maxlength="20" /> 
</td>

//下面是js
$().ready(function() {
var parameterIndex = 1;

// 增加可选项
$addOption.live("click", function() {
var $this = $(this);
[@compress single_line = true]
var trHtml = 
'<tr class="optionTr">
<td>
&nbsp;
<\/td>
<td>
<input type="text" name="delStorageInventoryIn['+parameterIndex+'].upc" class="text upc" />
<\/td>
<td>
<input type="text" name="delStorageInventoryIn['+parameterIndex+'].memberSn" class="text memberSn" "/>
<\/td>
<\/tr>';
[/@compress]
$attributeTable.append(trHtml);
parameterIndex ++;
});


------解决方案--------------------
引用:
没有 达到效果

那就不知道你要弄成什么样子了