I've just installed Forms 11 Update 5 (11.0.2311.50553) on a test server, and I'm testing the new LFForm.onFormSubmission functionality that was added with the Javascript in the new designer.
I'm trying to have it react differently based on which submission button was clicked, and it sounds like this is possible using the handlerName functionality.
Here's what the Help documentation says:
So I wrote this simple code to try to confirm it was working as expected:
LFForm.onFormSubmission(function() { console.log('Submit'); }, {handlerName: "Submit"} ); LFForm.onFormSubmission(function() { console.log('Approve'); }, {handlerName: "Approve"} ); LFForm.onFormSubmission(function() { console.log('Reject'); }, {handlerName: "Reject"} ); LFForm.onFormSubmission(function() { console.log('Save Draft'); }, {handlerName: "SaveAsDraft"} );
I was expecting single line to be listed in the console indicating which submission had been clicked. But unfortunately, no matter which one I click, the console lists all four:
I'm sure I probably just missed some small detail, but I've been struggling to get this simple code working for over an hour now without success.
Any suggestions?