Javascript to set label value in asp.net listview
<p>I have an asp.net listview with a column that contains 2 buttons, a textbox and label.</p>

<p>When a button is clicked a javascript function is executed.  </p>

<p>This function takes the value in the textbox and then starts a count down in the label.</p>

<p>Problem is, no matter what row I select, it takes the value from first row of the listview and sets the label in the first row of the listview also.</p>

<p>I have made dozens of attempts to get this to work, but can't get it to use the right row. </p>

<p>How can I make sure it gets and sets the correct values?</p>

<p>Thank you</p>

<pre><code>function countdown() {
      interval = setInterval(function () {
          var lbl = document.getElementById("ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_lblCountDown");
          var txt = document.getElementById("ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_txtTimeMinutes");


  &lt;asp:Button ID="buttStartTimer" runat="server" OnClientClick="javascript:countdown()" Text="Start" /&gt;
  &lt;asp:Button ID="buttStopTimer" runat="server" OnClientClick="javascript:stopcountdown()" Text="Stop" /&gt;
  &lt;asp:TextBox runat="server" ID="txtTimeMinutes" Text='&lt;%#Eval("FormulaTiming")%&gt;'&gt;&lt;/asp:TextBox&gt;
  &lt;asp:Label ID="lblCountDown" runat="server" Text=""&gt;&lt;/asp:Label&gt;
</code></pre>

<h1>Other Attempts</h1>

<pre><code>  &lt;%--&lt;input type="button" onclick='countdown()'; value="Start" id="Start" /&gt;
  &lt;input type="button" onclick='stopcountdown()'; value="Stop" id="Stop" /&gt;--%&gt;
  &lt;%--&lt;input type="button" onclick='countdown(this.form.TimeMinutes, this.form.spCountDown)'; value="Start" id="Start" /&gt;
   &lt;input type="button" onclick='stopcountdown()'; value="Stop" id="Stop" /&gt;--%&gt;
  &lt;%-- &lt;input type="button" onclick='&lt;%# Eval("FormulaTiming", "countdown({0});")%&gt;' value="Start" id="Button2" /&gt;
  &lt;input type="button" onclick='stopcountdown()'; value="Stop" id="Button3" /&gt;--%&gt;
  &lt;%--&lt;input type="text" value='&lt;%#Eval("FormulaTiming")%&gt;' id="txtTimeMinutes" /&gt;--%&gt;
</code></pre>
