This project has moved and is read-only. For the latest updates, please go here.

HideSPField works, GetSPField doesn't

Jul 20, 2015 at 2:13 PM

When I hide a field with SPUtility.HideSPField('fieldname') the field gets hidden
When I try to make the field readonly with SPUtility.GetSPField('fieldname').MakeReadOnly() the field doesn't get read only.
When i put myvar=SPUtility.GetSPField('fieldname') between Try{} and the catch e and alert e I get the error:
Error creating field named fieldname: Unable to retrieve the input control for fieldname

This is for all types of field in my list.
Jul 23, 2015 at 12:30 PM
Found the problem.....

I opted for the fastest way to implement. Without the $(document).ready function

This works okay for hiding field but not for making them read-only......
Marked as answer by SanderSmit on 7/23/2015 at 4:30 AM