I've successfully used the following script in NewForm.aspx to hide a column 'Date SharePoint checked' when another column 'Check SharePoint?' is set to 'No'.
When I open the same list item in EditForm.aspx or ListForm.aspx I need it to also hide the column. The script works when the Yes/No column is changed, but I need it to work on the existing value when the item is opened. Can the existing script be modified for that? Thanks.
//Show/hide columns based on Drop Down Selection
$("select[title='Check SharePoint?']").change(function() {
if ($("select[title='Check SharePoint?']").val() != "Yes")
{
$('nobr:contains("Date SharePoint Checked")').closest('tr').hide();
}
else
{
$('nobr:contains("Date SharePoint Checked")').closest('tr').show();
}
});