Hide dynamic form fields if there's nothing in them

Unfortunately, the section headers will stay there if all the fields
are empty, but fixing that would require some bigger changes than I'd
like to make.