Coordinator
Apr 23, 2012 at 3:38 PM
Edited Apr 23, 2012 at 3:38 PM
|
Ok I just tested this again using Prototype 1.7, SPUtility.js 0.8, SP 2007, IE 8. I have the following script included in a CEWP on EditForm.aspx:
<script type="text/javascript" src="/sites/Kit/Kits Site Documents/prototype.js"></script>
<script type="text/javascript" src="/sites/Kit/Kits Site Documents/SPUtility.js"></script>
<script type="text/javascript" src="/sites/Kit/Kits Site Documents/SPUtility-example.js"></script>
The following is in SPUtility-example.js:
/* SPUtility.js example script */
// run after the page has loaded
Event.observe(window,'load',function(){
try {
// TODO: Put your code here...
SPUtility.GetSPField('Title').MakeReadOnly();
SPUtility.GetSPField('Date Field').MakeReadOnly();
SPUtility.GetSPField('Date Time Field').MakeReadOnly();
} catch (ex) {
alert(ex.toString());
}
});
I was able to get it to break when the Date field is EMPTY... but not when it has a value.
Do you have any other scripts being included on the page? jQuery perhaps?
Can you try this version and let me know if it works? http://sputility.codeplex.com/SourceControl/changeset/view/c013f52e01d4#SPUtility.js
|