Hide blank readonly fields?

Forums Dynamic Forms for SharePoint Hide blank readonly fields?

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 6 days, 21 hours ago.

  • Author
    Posts
  • #21652

    Keith Hudson
    Participant

    I would like to hide any readonly fields that have no value in them. I’ve tried several approaches, none of which have worked yet.

    Is there code I can use to do so?

  • #21685

    Alexander Bautz
    Keymaster

    Hi,
    You can use something like this to hide the empty fields in your current tab:

    jQuery.each(spjs.dffs.data.tabConfigObj[spjs.dffs.data.selectedTab].fields,function(i,id){
    	if(id.indexOf("dffsHeading_") < 0 && id.indexOf("dffsHTML_") < 0 && id.indexOf("dffsRow_") < 0){
    		var tr = jQuery("#dffs_" + id);
    		if(tr.hasClass("dffs-readonly") && getFieldValue(id).length === 0){
    			tr.hide();
            }
        }
    });

    Alexander

You must be logged in to reply to this topic.