Q:

Hide columns in display form based on a value

I have the below javascript to hide columns in New/Edit form:
jQuery(document).ready(function($)
{
    if ($("select[title='Column1']").val() == "Value1") 
    { 
        $('nobr:contains("Column2")').closest('tr').hide();
    } 
});

But in display form,this script is not working work.
Can someone point what I am doing wrong?

A:

Finally i managed to hide columns(based on the value of another column) in display form by following the below steps:

Open SharePoint Designer and create a new display form.
Click Home tab(in ribbon) and select "Advanced Mode".
In the form,click the field in which you want to check the condition.For eg: Consider the field to be "Status"
Now add  above the  tag,that is we are adding a refernce id named "Status" for the Status field in the form.Add  below  tag.
In the form,now click the field which you want to hide.Consider this column name to be "Column1".Once you click the field(in the form),the code will highlight the table code for the field.
Now add id="Column1" within the  tag like .We are adding an id named "Column1" to the row which displays the field Column1.
Follow Steps 5 and 6 and provide unique ids for all the fields you want to hide.Consider we are hiding another column named "Column2" by providing id="Column2" within the  tag
Save the SharePoint Designer changes.
Now in the SharePoint Designer code,search for "PlaceHolderAdditionalPageHead".
Inside the "PlaceHolderAdditionalPageHead" Id,add the below script just above 

<script>
$( document ).ready(function() {
if($("#Status").text()=="In Progress")
{
$("#Column1").hide();
}
else if($("#Status").text()=="Completed")
{
$("#Column2").hide();
}
});
</script>

In the above script ,"Status","Column1","Column2" are the unique ids we added for each field in Steps 4,6 and 7.
"In Progress" and "Completed" are the values in Status column,that is if the value of "Status" is "In Progress",then "Column1" will be hidden.
​If the  value of "Status" is​ "Completed",then "Column2" will be hidden.

