I have a custom list in SP 2013. At the new form the users can add values to the input fields. I would like to trigger an event when the save button is pressed, but only if the save function ll be realy executed. For example no input compatibility problems for the fields, no unique input problems ect.

In short, how to check the save function ll be activated before use the onclick event? (Using javascript)

Thank you very much for any suggestions!


Based on title, If you are looking to validate the data before saving it to SharePoint list. You can use PreSaveAction() function in your SharePoint list form by referring Jquery file.

By using PreSaveAction() function you can validate the data and submit only if it valid to SharePoint.

Here is syntax:

function PreSaveAction(){
        return true;

        return false;

Further reference: http://www.c-sharpcorner.com/UploadFile/sagarp/use-of-presaveaction-function-on-list-forms-in-sharepoint-20/

  • Thank you very much sounds like exactly what I am looking for! I ll test it soon. – Nefri Oct 5 '17 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.