This project has moved. For the latest updates, please go here.

Read-Only single text field error

Oct 31, 2014 at 3:58 PM
Hi Kit,

I have a column in type of "Single line of text", with name "ProjectID". I had created the script for set the value in format "Projet1-XXX-XXX-00001". I want to make this column in Read-Only. in Newform and Editform. But I did not success. Nothing has changed.
Is there something I could be missing here? Please help me. Thank you very much !!!!
<script src="/SiteAssets/TestReadOnly/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/SiteAssets/TestReadOnly/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>
<script src="/SiteAssets/TestReadOnly/sputility.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function() {

SPUtility.GetSPField('ProjectID').MakeReadOnly();
SPUtility.Debug(true);

});
</script>
Oct 31, 2014 at 4:04 PM
I use SharePoint 2010 and IE8
Coordinator
Oct 31, 2014 at 9:50 PM
Qian,
I will take a look this weekend. I don't see any glaring issues at first glance. Some quick notes:
  1. Are you getting a javascript or error? You can press F12 to see the developer console and copy/paste any errors. Any error information is helpful.
  2. Have you used SharePoint designer or Infopath to customize the form?
The other tough thing here is... I don't have a SharePoint 2010 environment to test with...
Thanks,
Kit
Oct 31, 2014 at 10:33 PM
Hello,
  1. I don't have error message. When I put code to newform page, nothing has changed.
  2. I don't use SP designer or InfoPath. I know JavaScript cannot work in custom form. :)
I will make more tests. Enjoy your Weekend. It is not urgent.
Coordinator
Nov 12, 2014 at 3:58 AM
Under List Settings -> Advanced options, is " Launch forms in a dialog?" set to "Yes"? If so, is it possible to try with this set to "No"?