As of June 2016, version 0.14.2 is the final release of SPUtility.js and I will no longer be actively maintaining this project. Thank you to everyone who helped make this project a success!
As always, the code is available on GitHub so please feel free to fork / modify it yourself.
SPUtility.js is a JavaScript library used to make modifications to SharePoint's list forms (NewForm.aspx and EditForm.aspx in a survey, custom list or library). It works with SharePoint 2007, 2010, and 2013 (including SharePoint Online / Office 365).
SPUtility.GetSPField('Title').SetValue('Hello world!');
Download the latest from GitHub!!
Features:
This can be used for:
Keep in mind that SPUtility.js and documentation are still a work in progress... and that it won't work in every situation. It currently will NOT work with:
To use the library, you can just upload SPUtility.js and dependent files into a document library and put a Content Editor Web Part with some JavaScript code on whichever page you want to modify! Detailed instructions are on the Installation page.
See the Documentation for the matrix of supported fields and API documentation. Browse the Changelog to see the list of updates.
If you do find something that you would like supported or isn't quite working, please don't hesitate to post a Discussion.
Finally, if you use SPUtility.js and like it, tweet at me! @kitmenke
SPUtility.GetSPField('Title').SetValue('Hello world!');
Set a Text field's value and make it read only
SPUtility.GetSPField('Title').SetValue('Hello world!').MakeReadOnly();
Before
SPUtility.GetSPField('Status').MakeReadOnly();
After
Before
SPUtility.GetSPField('% Complete').Hide();
After
See the Documentation for more information.