Jump to content

Recommended Posts

Posted

Hello

Is there a way for a module to get an event via JS/JQuery when (actually before) a Page is saved?

For example for showing an alert like "There are unsaved changes" or saving these changes automatically (Ajax)?

Thank you.

Posted

@dragan Thanks, but this ist PHP, right? I need JS.

But I think this seems to work afaics now.

$("#submit_save").bind("click", function() { alert('beforesave'); return true; });

Thank you.

Posted

Yes, that's PHP, but you can also inject JS in a hook with

$js = "<script>your script here...</script>";
$event->return = str_replace("</body>", "{$js}</body>", $event->return);

 

  • Like 1
  • 2 weeks later...
Posted

Hey there, @theo! Just wanted to notify you that I'm moving this topic to the "Module/Plugin Development" subforum.

The "Modules/Plugins" forum area is where support boards for existing modules live, while all module development related topics belong to the "Module/Plugin Development" subforum. Thanks, and sorry for the disturbance ?

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...