Pass input type = text and span from asp.net listview
<p>I have an asp.net listview with a column that contains, 2 input type = button (id=Start, id=Stop, 1 input type = text (id=TimeMInutes) and 1 span(id=spCountDown).
The HTML rendered from all these controls including the listview is...</p>

<pre><code> &lt;table id="ctl00_ContentPlaceHolder1_lstViewFormulas_itemPlaceholderContainer" style="vertical-align:top; border:solid 1px gray"&gt;
        &lt;tr id="ctl00_ContentPlaceHolder1_lstViewFormulas_Tr1" style="vertical-align:top; border:solid 1px gray"&gt;
            &lt;td class="ListViewHeader" style="width:20%"&gt;
                 &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_lblFormName"&gt;Step Name&lt;/span&gt;&lt;/td&gt;
            &lt;td class="ListViewHeader" style="width:10%" align="center"&gt;
                 &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_lblTiming"&gt;Timing&lt;/span&gt;&lt;/td&gt;
            &lt;td class="ListViewHeader" style="width:30%"&gt;
                 &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_Label6"&gt;Area Used&lt;/span&gt;&lt;/td&gt;
            &lt;td class="ListViewHeader" style="width:10%"&gt;
                 &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_lblClock"&gt;Timer&lt;/span&gt;&lt;/td&gt;
            &lt;td class="ListViewHeader" style="width:30%"&gt;
                 &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_lblProd"&gt;Products&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;


        &lt;tr style=""&gt;
           &lt;td&gt;
              &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_lblFormName"&gt;Step 1&lt;/span&gt;
           &lt;/td&gt;
           &lt;td&gt;
              &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_lblTiming"&gt;20&lt;/span&gt;
           &lt;/td&gt;
           &lt;td&gt;
              &lt;span id="ctl00_ContentPlaceHolder1_lstViewFormulas_ctrl0_lblAreaUsed"&gt;Scalp&lt;/span&gt;
           &lt;/td&gt;
           &lt;td&gt;

            &lt;input type="button" onclick="countdown(document.getElementById('TimeMinutes'), document.getElementById('spCountDown'))"; value="Start" id="Start" /&gt;
            &lt;input type="button" onclick='stopcountdown()'; value="Stop" id="Stop" /&gt;


            &lt;input type="text" value='20' id="TimeMinutes" /&gt;
              &lt;span id="spCountDown"&gt;&lt;/span&gt;
           &lt;/td&gt;
</code></pre>

<p>I am trying to pass the "TimeMinutes" input type = "text" and the "spCountDown" Span into a javascript function.</p>

<p>I have tried several ways, including...</p>

<pre><code>&lt;input type="button" onclick="countdown(document.getElementById('TimeMinutes'), document.getElementById('spCountDown'))"; value="Start" id="Start" /&gt;
</code></pre>

<p>I have also tried to find these controls within the javascript function using the input id, but I don't get the right row.</p>

<p>I need to take the value from the input type = text and in the javascript function start a countdown.</p>

<pre><code>  var interval;
  var seconds=0;
  function countdown(txtminutes, spanid) {
      interval = setInterval(function () {
          var sp = document.getElementById("spanid");
          var minutes = document.getElementById("txtminutes").value
          if (seconds == 0) {
              if (minutes == 0) {
                  sp.innerHTML = "countdown's over!";
                  clearInterval(interval);
                  return;
              } else {
                  minutes--;
                  seconds = 60;
              }
          }
          if (minutes &gt; 0) {
              var minute_text = minutes + (minutes &gt; 1 ? ' minutes' : ' minute');
          } else {
              var minute_text = '';
          }
          var second_text = seconds &gt; 1 ? 'seconds' : 'second';
          sp.innerHTML = minute_text + ' ' + seconds + ' ' + second_text + ' remaining';
          seconds--;
      }, 1000);
  }

  function stopcountdown() {
      window.clearInterval(interval);
      var sp = document.getElementById("CountDown");
      sp.innerHTML = ''
  }
</code></pre>

<p>How can I pass in these controls so I can get and set the right value from the right row?</p>

<p>Thanks</p>
