Select td elements if checkbox is on
<p>I have this table, from which i'd like to select all the <code>td</code> elements value if the checkbox is <code>checked</code> and then put all the elements in some array or string, so that i can transfer it to server side.</p>

<pre><code>&lt;table id="tableDg"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;input type="checkbox" class = "chkbCsm" &gt;&lt;/input&gt;&lt;/td&gt;
         &lt;td width="10%" align="center"&gt;&amp;nbsp;&amp;nbsp;&lt;input type="hidden" id="nameText" readonly="true" value="{name}"&gt;{name}&lt;/input&gt;&lt;/td&gt; 
         &lt;td width="22%" align="center"&gt;&amp;nbsp;&amp;nbsp;&lt;input type="hidden" id="nameText" readonly="true" value="{host}"&gt;{host}&lt;/input&gt;&lt;/td&gt; 
  &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>Here is what i am doing on jquery side, but it does the selecting thing irrespective of the checkbox being on. Please somebody help me get it in some array.</p>

<pre><code>$('#tableDg tbody tr').live('click', function (event) {
    $(this).find('td').each( function( index, item ) {
       if ( $(this).has(':hidden') ) {
           alert( $(this).find(':hidden').val() );
       }
    });
});
</code></pre>

<p><strong>Added</strong> a jsFiddle link</p>

<p>Take a look <a href="http://jsfiddle.net/abhisheksimion/vAYFL/2/" rel="nofollow">here</a></p>
