I've successfully found a way to hide collection rows when all of the fields in that row are hidden on the screen, but when the form saves, all of the collection rows are "visable" again (no fields are there, but the collection rows are there wasting space.
This is the saved document, but all of the "blank" lines should be hidden - they are hidden on-screen in Forms.
This is my code:
$(document).ready(function(){
$(document).ready(function () {
$('.trigger').change(function() {
$('.myCollectionCheckField').each(function() {
if($(this).hasClass('hidden'))
{
$(this).closest('div.form-q').addClass('hidden');
}
else
{
$(this).closest('div.form-q').removeClass('hidden');
}
});
});
});
});