Javascript method/event that I can register script to be executed on save
Hi Everybody
Do any of you guys know if there is a method that I can register script to execute on saving a document?
In v3 there was a method called addSaveHandler(handler) in editContent.aspx that could be called to register clientscripts to be executed on save. Do any of you know if a similar method exists in v4.5.2?
After a little look around I found that the addSaveHandler(handler) js method was still present, but has been moved to the bottom of the editContent.aspx page. Therefore calling the method from a control/data type resulted in an error that described that the method did not exist. After wrapping the call in the jQuery(document).ready(function() { } ); it now works.
I am trying to do the same thing, but while I see that addSaveHandler is defined, my handler never seems to get called. I am adding it like this. Any idea why this doesnt pop an alert after cliking the save or publish button?
I'm working on a complex datatype for Umbraco 4 (4.7.1.1), and need to store some data into a hidden field before the editor page is submitted. So what I need is to get informed when "save" or "save and publish" are clicked.
Javascript method/event that I can register script to be executed on save
Hi Everybody
Do any of you guys know if there is a method that I can register script to execute on saving a document?
In v3 there was a method called addSaveHandler(handler) in editContent.aspx that could be called to register clientscripts to be executed on save. Do any of you know if a similar method exists in v4.5.2?
Thanks a lot in advance :)
Kim
Hi everybody,
After a little look around I found that the addSaveHandler(handler) js method was still present, but has been moved to the bottom of the editContent.aspx page. Therefore calling the method from a control/data type resulted in an error that described that the method did not exist. After wrapping the call in the jQuery(document).ready(function() { } ); it now works.
jQuery(document).ready(function (){ addSaveHandler(save handler method here); });
I am trying to do the same thing, but while I see that addSaveHandler is defined, my handler never seems to get called. I am adding it like this. Any idea why this doesnt pop an alert after cliking the save or publish button?
Did anybody ever find a solution for this?
I'm working on a complex datatype for Umbraco 4 (4.7.1.1), and need to store some data into a hidden field before the editor page is submitted. So what I need is to get informed when "save" or "save and publish" are clicked.
Any ideas ?
Okay, found out with a little more digging.
No idea why, but when "save" is clicked, the save handlers are iterated and executed using eval, so this seems to solve everything:
Comment author was deleted
Agree with Steen, this doesn't work as described by Kim.
As a workaround, I'm adding event handlers to the actual save icons :(
is working on a reply...