title: jquery to loop through table, for each row and td concatonate values
body: <p>I have a table with several rows. each row has a product field, a grade field and a family field.</p>
  
  <p>There is then several checkboxes for each available size.</p>
  
  <p>a row in the table looks like this:</p>
  
  <pre><code>&lt;table class="authors-list" border=0 id="ordertable"&gt;
   &lt;tr&gt;
       &lt;td style="font-size:10px;"&gt;&lt;a class="deleteRow"&gt; &lt;img src="&lt;?php echo base_url() ?&gt;application/assets/images/delete2.png" /&gt;&lt;/a&gt;&lt;/td&gt;
       &lt;td &gt;&lt;input type="text" id="product1" name="product1" class="rounded"/&gt;&lt;/td&gt;
       &lt;td &gt;&lt;input type="text" size='5' id="qty1" name="qty1" class="rounded"/&gt;&lt;/td&gt; 
       &lt;td class="tdcheckbox"&gt;
        &lt;input type="checkbox"  id="h09_1" name="h09_1" class="rounded"/&gt;
        &lt;input type="text"  id="line_1_09" name="line_1_09" value=""&gt;
        &lt;input type="text"  id="size_1_09" name="size_1_09" value="09"&gt;
  
      &lt;/td&gt; 
       &lt;td class="tdcheckbox"&gt;
        &lt;input type="checkbox"  id="h12_1" name="h12_1" class="rounded"/&gt;
        &lt;input type="text"  id="line_1_12" name="line_1_12" value=""&gt;
        &lt;input type="text"  id="size_1_12" name="size_1_12" value="12"&gt;
      &lt;/td&gt; 
       &lt;td class="tdcheckbox"&gt;
        &lt;input type="checkbox"  id="h15_1" name="h15_1" class="rounded"/&gt;
        &lt;input type="text"  id="line_1_15" name="line_1_15" value=""&gt;
        &lt;input type="text"  id="size_1_15" name="size_1_15" value="15"&gt;
      &lt;/td&gt; 
      &lt;td&gt;&lt;input type="text" name="cubespercheck_1" id="cubespercheck_1" value="0" size=5&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="skufamily_1" id="skufamily_1"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="skugrade_1" id="skugrade_1"&gt;&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  &lt;input type="button" id="continue" value="continue"&gt;
  </code></pre>
  
  <p>all fields will be hidden in end result besides the product field.</p>
  
  <p>To give you a background, my product code looks like this:
  3811460S5
  38114 is the width and height
  60 is the length
  Cr is the grade.</p>
  
  <p>What I want to happen is that when I click the button, jquery must loop through all tables cells. where there is a CHECKED checkbox AND product has been populated, jquery must join the fields as below:
  skufamily(for row[skufamily])+length(from cell[size])+grade(from row[skugrade])</p>
  
  <p>this result must populate the current td input <code>line</code>. so now each cell will have an exact sku (only if checked and product populated)</p>
  
  <p>skufamily,size, and grade is prepopulated so just need the jquery to loop and join the fields.</p>
  
  <p>here is a fiddle to play on. <a href="http://jsfiddle.net/QS56z/" rel="nofollow">http://jsfiddle.net/QS56z/</a></p>
  
  <p>I have tried the following concept but cant quite nail the code.</p>
  
  <pre><code>    function createcodes() {
  $("table.authors-list").find('input[type="checkbox"][name^="h"]:checked').each(function () {
   if (&lt;checkbox is checked&gt;)
        document.getElementById(input[type="skufamily").value + 
        document.getElementById(input[type="size").value +
        document.getElementById(input[type="skugrade").value
  
          });
  </code></pre>
  
  <p>This is far from correct so if you can put me on the right path I'd appreciate it.</p>
  
  <p>Thanks a million as always.</p>