0

So here is my problem:

I'm using a Wordpress plugin that handles my forms (contact form 7). Within that plugin there is a function that shows a message, when a mail is been successfully sent(not succesfully submitted). But the message stays there until the page is reloaded. I want to remove that message after a few seconds. The message is in a div with a class of .wpcf7-repsonse-output.

Contactform 7 provides, within the admin section of the plugin, an option to add custom code after an event, so I added this:

jQuery('.wpcf7-response-output').delay(3000).slideUp(400);

The code does what it suppose to do, but does it right after the event and after that the standard function fires, so the message is still there...

I have found the function that handles this event and I can add my code to it to work, but when the plugin gets an update, my code is obviously gone.

I would prefer not to add my code to the admin section of the plugin aswell. So I would like to create a separate file where my code hooks into the existing functionality. Is that possible?

Thank you.

2
  • You can listen to the event where the div is created, as described here: stackoverflow.com/a/15268923/416947
    – Ohad
    Sep 30, 2015 at 12:23
  • @Ohad, thnx for your reply, but PHP creates the div and decides which one to show. jQuery just handles the visibility.
    – Denzorrr
    Sep 30, 2015 at 12:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.