Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  8] [ 2]  / answers: 1 / hits: 46563  / 12 Years ago, wed, april 4, 2012, 12:00:00

I have a SharePoint list with the following single line of text fields: Title, Year and Type or Location. I want to be able to hide the Type or Location table row in the default display form. I know that I should create a JavaScript script and put it in Content Editor web part inside DispForm.aspx.



I am not fluent with jQuery syntax, thus I need help with the code, i.e. I don't know how to reference the table row which contains Type or Location field and its value. Here's what I've done so far, but it doesn't work:



jQuery(document).ready(function($) {
$(input[title='Type or Location']).closest(tr).hide();
});


I know that the input[title='Type or Location'] part is incorrect; at least I think it's that. Could anyone help me out? Thank you.


More From » jquery

 Answers
6

Try:



jQuery(document).ready(function($) {
$(h3.ms-standardheader:contains('Type or Location')).closest(tr).hide();
});

[#86422] Tuesday, April 3, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magaly

Total Points: 524
Total Questions: 96
Total Answers: 89

Location: India
Member since Wed, Aug 26, 2020
4 Years ago
;