How to attach an onSubmit script to work_notes/comments fields in Incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 02:42 PM
I can create an onSubmit client script for the Incident view, and it runs if I click "Update" in the top right.
However, it does not run if I use "Post" which is right next to the work_notes and/or comments field in the incident 'feed' section.
How do I connect to this Post button so I can also run my script if that is clicked instead of Update?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2018 08:02 AM
Thanks for the hint, I did not manage it to work on Jakarta. I can successfully locate Button Element and attach my event, but it doesn't get fired. The reason is probably the fact, the implementation of Angular directive ng-click
the function postJournalEntryForCurrent
contains code line: event.stopPropagation();
The maximum I achieved is turn the button entirely off:
function onLoad() {
var btnPost = document.getElementsByClassName('activity-submit')[0];
btnPost.setAttribute('ng-click', '');
btnPost.setAttribute('ng-keypress', '');
btnPost.setAttribute('style', 'display:none;');
}