Is there a way to trigger a JavaScript function to execute when a new item is added to a list?
I have a task list with a Priority column. The Priority column is storing a unique number for each item in the list (so each task has an assigned priority number).
When a new task is added with a Priority number that is already in use, I want to increment the priority number of each item with a higher priority number then the new task. If I can grab the ID and priority number of the new item, then I believe I can accomplish the rest with SPServices
.
But I don't know how to trigger the JavaScript function when a new item is added (and grab the necessary data from the newly added item).