user1580944
user1580944

Reputation: 27

Reading data or labels of a sharepoint site?

Hello everybody! My problem is that i want to read any data of a SP-Site. So i tried to run a javascript code with a content editor webart which i added to a Site. There i trie to use:

var name = document.getElementById("labelName").value; 
alert(name); 

But the alert doesn't show me a value. It always shows "undefined".

So I want to ask if it's possible to read the data of labels or something with javascript code in a WebPart or not. And if it's possible how I'm able to do it.

Upvotes: 0

Views: 179

Answers (1)

haydnD
haydnD

Reputation: 2293

yes, but the id may not be exactly what you expect it to be.

go into the list / library that the element is part of. Right click the column name. In IE you will click properties.

the end of that value is what you want. so for example: 'Percent%5Fx0020%5FComplete'

Here is a good article on it

http://sympmarc.com/2009/12/11/staticname-versus-displayname-on-sharepoint-lists/

Upvotes: 1

Related Questions