2012-01-27 4 views
0

다음 테이블에서 click function (removeRow)에서 textbox (txtTotalAmount)의 값을 가져 오려고합니다. td 입력 텍스트 상자 값을 가져 오는 방법은 무엇입니까?

나는 여기에이

function removeRow(name) { 
    $(name).parent().parent().remove(); 
    var total = $(name).parent().parent().siblings().find("input .classTotalAmount").val(); 
    alert(total);// shows only undefined in alert box 
} 

을 쓴 내 테이블

<table id="tblitems" cellpadding="0" cellspacing="0" border="0" class="additemtb"> 
    <tbody> 
     <tr> 
      <th>Item Name</th> 
      <th>Item Code</th> 
      <th>Unit Price</th> 
      <th>Qty</th> 
      <th>UOM</th> 
      <th>Amount</th> 
      <th>Minimal Order Qty</th> 
      <th>FOC</th> 
      <th></th> 
     </tr> 
     <tr> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td></td> 
      <td style="width:90px;"> 
       <a href="javascript:void(0)" class="copy" onclick="copyRow(this);">Copy</a> 
       <a href="javascript:void(0)" class="delete" onclick="removeRow(this);">delete</a> 
       <a href="javascript:void(0)" class="add" onclick="addRows(this)">add</a> 
      </td> 
     </tr> 
     <tr> 
      <td></td> 
      <td >Total Amount</td> 
      <td> 
       <asp:TextBox ID="txtTotalAmount" CssClass="classTotalAmount number" Columns="8" runat="server" ></asp:TextBox> 
       <asp:Label ID="Label2" runat="server" CssClass="classCurrency3" /> 
      </td> 
      <td>&nbsp;</td> 
     </tr> 
    </tbody> 
</table> 
+0

테이블? html 코드 넣기 – robasta

답변

0
var amount = $("#txtTotalAmount").val(); 
관련 문제