[Hustle] hustle click trigger not working with embedded forminator form in content of popup

how do i correctly embed a forminator form into hustle?

maybe i found a bug.

when embedding a forminator form by shortcode f.e. [forminator_form id="0001"] into the main content field of a hustle popup something is going wrong.

1. the popup always shows up on pageload for the first time. the popup-trigger rules are being ignored…

2. the form data variables i use within different steps of a form (multi part form) only show up when i'm loggedin as admin but they don't if i'm not?!

i tested it on a basic simple installation with a basic wp-theme here:

No form in popup: http://wp.benjaminmeyer-webdesign.de/

form in popup: http://wp.benjaminmeyer-webdesign.de/demo/

  • James Morris
    • WordPress Enthusiast

    Hello Beni

    Taking a look at your site, I was able to see the form in the popups without issue and I was able to step through the form and complete it. You probably got a couple unusual form submissions from me. :slight_smile:

    However, I did notice that the triggers are not functioning correctly. I mirrored your setup on my own dev site where there’s no other plugins installed and I’m using a default theme. I was able to reproduce the symptoms as was one of my colleagues.

    We are flagging this as a bug so our Dev Team can investigate this issue further. An update to the plugin will be published once this issue is resolved. Thank you for your patience while we sort through this.

    Best regards,

    James Morris

  • Beni
    • Flash Drive

    Hi James! Thanks for your fast support, i’ve already noticed you mails :wink: I’m not shure if my explanation was good.

    – the multi step pagination is working

    – BUT: on the second page of the form i added the form data of user_name. The value only is shown when logged in as admin but it’s not when logged out and filling out the form…

    …just to make shure you got me right :wink:

    Best regards, Beni

  • Ash
    • WordPress Hacker

    Hello Beni

    The value only is shown when logged in as admin but it’s not when logged out and filling out the form

    When you are logged out, then you don’t have any username, at least the site can’t detect any username. That is the reason there is no value when you are logged out. What happens when you try by logging in as different users, do you see always the logged in user’s username?

    And what is your suggestion should be appropriate for this field? We can discuss and try to find an alternative, perhaps :slight_smile:

    Have a nice day!

    Cheers,

    Ash

  • Beni
    • Flash Drive

    Ahhhhh, now i got it. It’s not the value of the name field of the form, it’s the real user name. Sorry for being blind.

    I think you know what i’m aiming for :wink:

    Is there a way to use the value a user types into a form field for example his name and add it into a text field in the same way you can add form data? This is how we could make the form more like a “conversation”….

  • Ash
    • WordPress Hacker

    Hello Beni

    Is there a way to use the value a user types into a form field for example his name and add it into a text field in the same way you can add form data? This is how we could make the form more like a “conversation”….

    I think in that case you can use a text field but change the label to user name, then it would be a field that user can fill. There won’t be any automatic filling with username though, but at least user can write that if he knows the username.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,

    Ash

  • Beni
    • Flash Drive

    Hi Ash,

    …sorry, but i’m not shure if you got me right.

    My scenario:

    – i have a multi step form

    – on the first page i’m asking for some personal data like “name, phone, email”

    – on the second page i want to have a text which says: Hello, “name”! Nice to meet you!

    – actually it’s only working with some predefined form data. i can use my own form fields in the mail only but not within the form…

    You know?!

  • Ash
    • WordPress Hacker

    Hi Beni

    That makes sense now! I think this is doable by some custom code, but it has to be form specific.

    Do you want something like this video? http://recordit.co/YhtizAMZCo

    If so, then use the class names used in the video and the following as html content:

    <p>Hello <span class="custom_form">&nbsp;</span></p>

    And then, use the following code:

    add_action( 'wp_head', function() {
    ?>
    <script type="text/javascript">
    jQuery(function($){
    $('.name_field input[type=text]').on('keyup', function(){
    $('.custom_form').html( $(this).val() );
    });
    });
    </script>
    <?php
    } );

    You can use this code in your child theme’s functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,

    Ash

  • Vaughan
    • Support/SLS MockingJay

    Hi Beni

    Just posting this patch here which should fix the forminator-hustle issue with the popup always appearing regardless of the click trigger being required.

    Upload the following files from the attached zip

    main.js

    upload to /wp-content/plugins/forminator/build/

    Upload the following files to:

    /wp-content/plugins/forminator/build/front

    front.multi.js and front.multi.min.js

    Hope this helps

  • Beni
    • Flash Drive

    Hi Vaughan,

    …thanks for your fix. Unfortunately, it’s not working on my testsite. I replaced the files… but nothing seemed to change. The PopUp still opens automatically on pageload, although the trigger is set to click. The open button itself is working fine… Maybe it’s my fault and the configuration is wrong?! I gave you Support access. Would you mind to have a look?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.