0

Is it possible to get the value of a person-type field from a custom list before hiding it with the $ (document) .ready method?

I really need to get that value and I do not want the field to be seen on my page

2
  • im not getting the statement "before hiding it with the $ (document) .ready method" Jan 20, 2017 at 4:17
  • The scenario is very unclear from your description. Another approach would be to remove the field from listview. Then access the field information using JavaScript when needed. sharepoint.stackexchange.com/questions/197488/…
    – t0.
    Jan 20, 2017 at 10:48

1 Answer 1

0

jQuery solutions will always fire late in a jQuery ready event (once the page has loaded)

Same applies for any JavaScript solution... the DOM needs to be ready before you can do something with it.

instead, add CSS to the page before the field you want to hide is loaded

.ms-formtable tr:nth-child(1){
  display:none;
}

Will hide the first TableRow on the Form

You can wrap this in a <style> tag inside a Content Editor WebPart positioned above the Table

The field is still in the DOM, so now you can use JavaScript to show it (set it to table-row) if needed.

Your Answer

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

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