cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Workflow Hero

How to add code to a task form?

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!

0 Kudos
Reply
2 Replies
Workflow Hero

Re: How to add code to a task form?

thzu thzu‌, this would probably be a better question for the  space.  I can move this to that space if you'd like. 

Accept as Solution Reply
Workflow Hero

Re: How to add code to a task form?

yes, sure. thanks!

0 Kudos
Accept as Solution Reply