Tuesday, July 10, 2012

Hiding Empty Columns in Display and Edit form using JavaScript/Jquery

                       Hiding Empty Columns in Display and Edit form  using JavaScript/JQuery

To Hide columns in Display and Edit form both from SharePoint that are empty, for that you don't have get into custom code. A simple client side script is used in form of Jquery.

Code is as follows:

<script type=”text/javascript” src=”/Kishan/Scripts/jquery-v1.7.2.min.js”></script>
< script type=”text/javascript”>
$(“td.ms-formbody”).each(function()
{
// Remove all the white spaces

var val = $(this).text().replace(/\s|\xA0/g,”);


// We will check the string length if it's "0" , hide the field

if(val.length==0){
$(this).parents(‘tr:first’).hide();
}
});

< /script>

To download the Jquery Script file. Click Here.

 

1 comment:

  1. Acting deals with very delicate emotions. It is not putting up a mask. Each time an actor acts he does not hide; he exposes himself. See the link below for more info.


    #hide
    www.ufgop.org

    ReplyDelete