Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

where to put javascript code?

$
0
0

Hello,

I am trying to set some columns in a list as "read-only" and is using the following code:

<script type=”text/javascript”>

function SetReadOnly()

{

var elements=document.getElementById(’4_ctl00_ctl00_TextField’);

elements.readOnly=true;

}

_spBodyOnLoadFunctionNames.push(“SetReadOnly()”);

</script>

But I am not sure where to put the code in. Should I put it in the space in Content Editor Web Part, or through a link to a txt file, or in "Edit HTML"? I've tried them but none works.

Thanks a lot!

Patrick


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>