AnsweredAssumed Answered

How to add code to a task form?

Question asked by thzu on Feb 20, 2017
Latest reply on Feb 20, 2017 by thzu

What I want to achieve: - users always forget to click the OK Button after reading a task - I want a message when someone closes the task tab like 'You closed this tab without closing the task. To close your task go to the ... and click the 'OK'-Button underneath the task description.

At first I tried the code at List -> form web parts -> default new form -> add web part: script editor

<body onunload="stop()">  <script type="text/javascript" language="JavaScript"> <!-- function stop() {   alert("Message from ...: You closed this tab without closing the task. To close your task go ... click the 'OK'-Button underneath the task description."); } //     --> </script>

and this worked. Now I want the same to happen with my task form. I use the default sharepoint form (no InfoPath, no nintex forms).

Any ideas where I can type in the code? Thanks!

Outcomes