Hide fields if empty

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
efiro
Posts: 2
Joined: Fri Mar 24, 2017

12 May 2017

Hello
What is the easiest way to hide fields if they are empty.
i'm going to print the form and I don't want to print the empty fields.
P.S. the fields are in a table

Thanks
Efi

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

12 May 2017

Hi,

Please, insert the following code into your form via JS-editor of Forms Designer:

Code: Select all

$.each($('.fd_field'), function() {
    if (!$(this).find('.fd_control').text().trim()) { $(this).parent().hide() }
})

efiro
Posts: 2
Joined: Fri Mar 24, 2017

12 May 2017

Thank you :)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests