check for a value in all textboxes in a row
<p>I keep getting an object returned when I check if any textboxes have a value in the supplied row or it only checks the first textbox.  I want to pass a row to the chkblock function and get a true back if any of the textboxes has a value.</p>

<p>Thanks in advance for your help,
Roy</p>

<p>You can see the entire thing here: <a href="http://jsbin.com/igaror/1/edit" rel="nofollow">http://jsbin.com/igaror/1/edit</a></p>

<pre><code>    &lt;html&gt;
    &lt;head&gt;
    &lt;script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;meta charset=utf-8 /&gt;
    &lt;title&gt;JS Bin&lt;/title&gt;
    &lt;!--[if IE]&gt;
      &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;
    &lt;style&gt;
      article, aside, figure, footer, header, hgroup, 
      menu, nav, section { display: block; }
    &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;table&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;input id='1' class='name' type='hidden' value='test 1'/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" value="44"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;input id='1' class='name' type='hidden' value='test 2'/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" class="room" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;

   $('.room').change(function() {
     var row = $(this).closest("tr");
     var block = false; //row.find(":text.room").val() !== "";
     var vname = row.find(":input.name").val();
     block = chkblock2(row);
       alert("name: " + vname + " block:" + block);
     if(vname == "test 1"){
       $(this).closest("table").find(":input.name").each(function() {
         if ($(this).val() == "test 2"){
           var row = $(this).closest('tr');
           row.find(":text").attr("disabled",block);
           row.find(":text").val("");
              }
     });
             $(this).closest("table").find(":input.name").each(function() {
         if ($(this).val() == "test 1"){
           $(this).closest("tr").find(":text").attr("disabled",false);
           //$(this).val('');
              }
     });

     } else if(vname == "test 2"){

       $(this).closest("table").find(":input.name").each(function() {
         if ($(this).val() == "test 1"){
           var row = $(this).closest('tr');
           row.find(":text").attr("disabled",block);
           row.find(":text").val("");
              }
     });


        $(this).closest("table").find(":input.name").each(function() {
         if ($(this).val() == "test 2"){
           $(this).closest("tr").find(":text").attr("disabled",false);
           //$(this).val('');
              }

     });  

     }



   });

function chkblock(row){
  return row.find("input:text:not(:empty)");
}

function chkblock2(row){
  row.find(":input.room").each(function() {
    if ($(this).val() !== "" ){
      return true;
    }
    });
    return false;
}
</code></pre>
