title: how to access other textbox on same line On asp:gridview using javascript
body: <p>I am trying to get value for txtQuantity on javascript : </p>
  
  <pre><code> &lt;asp:gridview ID="gvPOAdd" runat="server" ShowFooter="true" AutoGenerateColumns="false" OnRowDeleting="gvPOAdd_RowDeleting"&gt;
          &lt;Columns&gt;
    &lt;asp:TemplateField HeaderText="Quantity"&gt;
              &lt;ItemTemplate&gt;
  
                  &lt;asp:TextBox ID="txtQuantity" runat="server" Text='&lt;%#Eval("Quantity") %&gt;' CausesValidation="false" Enabled='&lt;%# ((Session["isNewPurchaseOrder"] != null) &amp;&amp; ((bool)Session["isNewPurchaseOrder"] == true )) ? false : true %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;br /&gt;
  
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
              &lt;asp:TemplateField HeaderText="Unit Cost"&gt;
              &lt;ItemTemplate&gt;
  
                    &lt;asp:TextBox ID="txtUnitCost" runat="server" CausesValidation="false" onkeyup="calculateTotalCharge(this,'&lt;%= txtQuantity.clientid %&gt;');" &gt;&lt;/asp:TextBox&gt;
  
  
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  &lt;asp:TemplateField HeaderText="Total Cost"&gt;
              &lt;ItemTemplate&gt;
                  &lt;div style="text-align:right;"&gt;
                      &lt;asp:Label ID="lblTotalCost" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/div&gt;
              &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p>
  PS : 
      onkeyup="calculateTotalCharge(this,'&lt;%= txtQuantity.clientid %>');</p>
  
  <p>and I am using the following script :</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
          function calculateTotalCharge(unitcost,quantity) {               
              alert(unitcost.value);           
              alert(quantity.value);
          }
  </code></pre>
  
  <p>// But I get an error quantity is null ?! </p>
  
  <p>how to access other textbox on same line On asp:gridview </p>