Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Michal Bachraty
    Participant

    Hi i use this widget on my client website and i need to do when someone click button cenova ponuka and fill all fields and send contact formular which is created on contact form7 i need to automatic close whole widget after clicking on ODOSLAT is it possible ?

    this is the website: https://mtmmal.sk/

    Hi Michal,

    Yes, it is possible. You can use the JavaScript call below to close the flyout once the form is submitted. Can you please refer the doc below?

    Custom trigger

    Thanks,
    Aakash

    Michal Bachraty
    Participant

    Thanks for the answer, but I don’t really understand it, where should I write the code please?

    Hi Michal,

    The plugin does not know the contents of the widget box are. I see you have a form here. You can check with the form plugin author and see if there is an option to call the function above as in the docs.

    I would suggest the JS code below from my side.

    <script>
    document.addEventListener('DOMContentLoaded', function() {
      const wpcf7Form = document.querySelector('.wpcf7-form');
    
      if (wpcf7Form) {
        wpcf7Form.addEventListener('submit', function(event) {
          UFW.close(1);
        });
      }
    });
    </script>
    

    Please paste this JS code snippet in your website.

    Thanks,
    Aakash

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter