We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


SHarepoint FieldDescription onchange event

jplatt1 asked
Medium Priority
Last Modified: 2012-05-11
I have a customer who would like to track changes made to a list in sharepoint.  They have several date fields, and want to know what the LAST date was in that field.  We were thinking a solution would be to create a new field that simply stores the last value.

I am trying to create a new field on the "EditItem" page so that when someone changes the value, another field gets auto-populated with the old value.  I was thinking of adding an onfocus, or onchange event - the issue is, I cant seem to figure out how to add the event.  I am okay with the javascript to make that work, but I dont know what part of the field to edit - I am new to sharepoint.

The field's definition looks like the following:

      <SharePoint:FieldDescription runat="server" id="ff21description{$Pos}" FieldName="_x004b_O3" ControlMode="Edit"/><SharePoint:FormField runat="server" id="ff47{$Pos}" controlmode="Edit" fieldname="_x004b_O3" __designer:bind="{ddwrt:DataBind('u',concat('ff47',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@_x004b_O3')}" />

Does anyone know how I can make it so when this field is either brought into focus, or is changed, some javascript executes?

Thanks in advance!
Watch Question

Top Expert 2009
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


Thanks 66866 - I actually have not looked into versioning as of yet....the customer wants something pretty specific, and i am not sure versioning will do what I want.  Because sharepoint stores all this stuff in the database, and we have some SSRS reports written based off that already, the idea was to build an ssrs report that would show the items dates changing over time.  I will look into versioning and see if I can get that to do it, but I still think this solution may be better.
Top Expert 2009

i am clear with your custom approach, however take a look at the versioning and if you like development you can create reports using SharePoint's API along with versioning.


Thanks - I have presented this as a solution to the customer, and will see what they think.  

The only potential problem I see - they only really care about when certain fields are changed.  I see the following scenario happening, which could potentially lose some history - say an item is set to hold 10 versions.  If one of the fields we care about gets changed, then 10 other changes come along, the change with the item we care about will get deleted, as only the last 10 versions are saved.  I guess what I really am looking for is versioning settings but only for specific fields.  I know we can set it to keep unlimited versions - that is something I have presented as well.  Will see if he approves of going this route, and if so, will close the question.  Thanks again - you have been a huge help!
Top Expert 2009

glad to be of help.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.