I have a custom Edit form in SP2013 where I want the Save button to do two things:
- Commit changes
- Call JavaScript function
The function in step #2 does several things including a workflow trigger. What I've done is hide the OOTB save button and create my own like so:
<input type="button" value="Send" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}; SendProject('http://site.com/subsite/Lists/Projects/{@ID}_.000');"/>
I think I'm close, but currently it's committing the changes then nothing. The form doesn't close and the second function never starts. I've tried it with and without the "javascript" identifier in front of the second function. Either call works by itself, so the issue is how I'm calling one after the other.
I also tried wrapping both in a function and calling the function on click, but the GenFireServerEvent doesn't seem to work from JavaScript.
After a few Google searches, I've found a couple of close ones, but no working solution yet. Any ideas what I'm doing wrong?