0

All,

I have a customized NewForm for my SP2013 List. It has three fields that the user doesn't need but should get updated depending on the text they enter in other fields. However since these fields are hidden they won't get updated. Why can't I update hidden fields?

var InformationFieldEncrypted = SPUtility.GetSPField('Information Required Encrypted');
var JustificationFieldEncrypted = SPUtility.GetSPField('Justification Encrypted');
var BackgroundFieldEncrypted = SPUtility.GetSPField('Background Encrypted');

  $().SPServices({
    operation: "GetGroupCollectionFromUser",
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
       completefunc: function (xData, Status) {
       var xml = xData.responseText;
       if (xml.search('Samenwerkende Eigenaren') != -1)
    {
         var feedbackField = $("input[title=Information Required Encrypted]");
         feedbackField.parent().parent().parent().hide();      
         var feedbackField = $("input[title=Justification Encrypted]");
         feedbackField.parent().parent().parent().hide();
         var feedbackField = $("input[title=Background Encrypted]");
         feedbackField.parent().parent().parent().hide();
         var feedbackField = $("input[title=Comments Encrypted]");
         feedbackField.parent().parent().parent().hide();
         _spBodyOnLoadFunctionNames.push("hideEdit");
    }

Is there a way to edit these fields on entering a new List item?

Marco

1 Answer 1

0

If these fields are defined as site columns and hidden, you can't see them in the NewForm display. Go to the list settings and create a new view, including the columns that are hidden for new item entry. You can manage them there.

On the NewForm, users will only see the fields you want them to populate, not any that are hidden. On any other custom view that you create for the list, you can display the hidden site columns.

6
  • K, tnx for answering my question. My point is that the hidden fields need to be updated but the user doesn't need to see them because the content is encrypted and doesn't make sense to him.
    – Marco
    Nov 27, 2017 at 19:40
  • Right – the key here is in the NewForm.aspx. That won’t display hidden fields. If you want to manage them, you’ll need to create or manage a view on the list itself (vs item entry new form). You can edit a list view web part to embed the javascript/jquery. Another option is to use targeted audience setting for your list view web part. If your security requires it you can enable item level security (on Issue and Task lists) so users can only see the new form fields, what you define as the default list, and only their own entries. Good luck!
    – KRobison
    Nov 28, 2017 at 17:01
  • K, the fields are not hidden by default. I make them hidden based on the user that is logged on. I think SharePoint won't let me update the fields when they are hidden like this: var feedbackField = $("input[title=Information Required Encrypted]"); feedbackField.parent().parent().parent().hide();
    – Marco
    Nov 28, 2017 at 22:19
  • I see, I didn't take that into consideration. You can hide those fields within their content type or in the list settings, then no one without Owner/Full Control permissions would be able to see them. But hiding them through javascript won't allow them to display at all. I hope that helps -
    – KRobison
    Nov 28, 2017 at 23:06
  • 1
    That helps. If I make them hidden in the list settings I don't need to check who is logged in at all and I don't need the javascript.
    – Marco
    Nov 29, 2017 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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