Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list with these columns Question, answer, Issue, Top FAQ, Summary, Q.No. The list is in a webpart on a wiki home page. When the user clicks on the link it brings all fields up. What I want is javascript code so that when user clicks they see question, answer, issue only. I am not what form to add the javascript - display, edit, new form.

share|improve this question

2 Answers 2

If I do not misunderstand you could use jQuery to hide data from the display form (/Lists/YOUR_LIST_NAME/DispForm.aspx). Put the code in a .txt in a Document Library and link it from a Content Editor WebPart, modifying the DispForm page.

An example of code could be:

<script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function() {
    $(".ms-formtable tbody > tr > td:contains('Top Faq')").closest("tr").hide();
    $(".ms-formtable tbody > tr > td:contains('Q.No')").closest("tr").hide();
})
</script>
share|improve this answer

I just posted this to codeplex this morning! https://lozzisp2013.codeplex.com/

Really simple to use, with more options around disabling and hiding.

<script type="text/javasccript">
$(document).ready(function(){
   Lozzi.Fields.disableWithAllowance("Start Date", ["Project Managers"]);
   Lozzi.Fields.disable("Task Status");
   Lozzi.Fields.hideWithAllowance("Predessor");
   Lozzi.Fields.hide("% Complete");
});
</script>
share|improve this answer
    
So I understand. What does the disable do. in your first lozzi statement, start date the column and project managers the name of the list. This is put into a .txt document and linked in a content editor webpart in the List < Form Web Parts > Default Display form? –  user2474612 Jan 14 at 18:38
    
the disable will take the value and just display it as text, outside of the control, so users can't edit it. See my post, davidlozzi.com/2014/01/14/…, for more details and a screen shot. The ["Project Managers"] piece is the name of a SP Group which is allowed to edit it, so it'll disable for all users except for those in the group. –  David Lozzi Jan 15 at 1:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.