Hide empty fields in Edit Form

Hi Plumsail,

I have a grid which contains some fields. In the edit form, I added these fields and there is a case where they are not populated at all by the submitter because its not applicable to them.

Is it possible to hide those fields that are empty in that grid as it creates unnecessary clutter on the form!

Many thanks as always for your endless support and help!

Dear @DryChips,
Sure, you can try something like this:

fd.spRendered(function(){
    var fields = fd.fields()
    for(var i in fields){
      var field = fields[i];
      var value;
      if(field.ready){
        field.ready(function(field){
            var value = field.value;
            if(!value){
              field.hidden = true;
            }
        });
      }
      else{
        var value = field.value;
        if(!value){
          field.hidden = true;
        }
      }
    }
});