I was able to work it out with this code if this helps anyone $(document).ready(function() { $('#chkInternal').click( function() { $('.internalField').each(function() { if ($("#chkInternal").is(":checked")) { alert("Showing all fields"); if ($(this).text() == "True") $(this).parent().css('visibility', 'visible'); } else { alert("Showing only product fields"); $(this).parent().css('visibility', 'hidden'); } }); }); });
On Sep 3, 10:30 am, "evanbu...@gmail.com" <evanbu...@gmail.com> wrote: > Hi > > I have a checkbox that when clicked I want to hide all of the entire > rows in my table where those fields with a class of internalField > equals True. The hiding part works well but when I uncheck the > checkbox the rows do not become visible again. So I guess my question > is how do I toggle the value of this checkbox (chkInternal) to hide/ > show these table rows? Thanks > > <input name="chkInternal" id="chkInternal" type="checkbox" /> > > <script language="javascript"> > $(document).ready(function() { > $('#chkInternal').click( > function() { > $('.internalField').each(function() { > if ($(this).text() == "True") > $(this).parent().css('visibility', 'hidden'); > else > $(this).parent().css('visibility', 'visible'); > }); > });}); > > </script>