Sharepoint Online Hide A Field
You can show or hide columns in a list or library as an alternative to deleting. When you hide a column, it doesn't affect the column or the data in the column, as it would if you deleted it. To reuse the column, you can just show it again. Requirement: SharePoint Online PowerShell to Hide Field In a project request list, when user fills the form we wanted to hide the 'Status' column by default and then have a workflow to populate status of the particular request.
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:
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.
6 Answers
Rich BennemaRich BennemaI am not sure why you want to use jQuery for that. In SharePoint, you can choose to make a field required, optional or hidden. In most cases, just switching to hidden will address your issue.
For the record, I would also try to avoid as much as possible the use of jQuery(document).ready, it might conflict with the SharePoint out of the box onload event. In your case it is not needed.
Spotify not working on pc. 8) Try starting up spotify again. (Hopefully it will start up with the new update!) I'm not sure WHY this works, but it did for me. Hope this helps! Having the same issue, starting today, on Windows 7. It is listed as an exception in my firewall and my antivirus is not blocking it.
Update: here is a way to do this with jQuery:
ChristopheChristopheIt depends what type of column Type ior Location is. If it's a Single line of text, then you're close. You should use a DOM inspector like IE's Developer Tools or Firebug to see what the actual title of the input element is.
If the column is a different type, then it's likely not an input element. Using the DOM inspector again, you can look at what elements make up the field control and decide on your selector from that.
Finally, remember that hiding things in script is not secure. A savvy user can turn off the script or otherwise change the script so that they can edit it. It all depends on your requirements.
// UPDATE //Ah, you said DispForm. As was pointed out in another answer, there aren't any input elements in a DispForm. You need to correct your selector.
Sharepoint Online Hide Field In Newform
If its just the Default Display Form, How about just creating a view and making it default?