Sunday, December 28, 2014

change NewForm2 behaviour

Hi,


According to your description, you might want to run some JavaScript when clicking the OK or Cancel button in the NewForm page.


Yes, there is a built-in function PreSaveAction() which will handle the event when user submit a new item to the database, you can add your custom JavaScript there.


Two links below with code demos would provide more information about PreSaveAction():


http://sharepointwings.blogspot.com/2012/06/javascript-presaveaction-in-sharepoint.html


http://www.ilikesharepoint.de/2014/06/sharepoint-presaveaction-helps-for-actions-before-saving-an-item/


Or you can provide more details about what you are going to achieve, maybe we can see if there any existing solution already.


Best regards,


Patrick




Patrick Liang

TechNet Community Support



No comments:

Post a Comment