• Resolved maryamait123

    (@maryamait123)


    Hello ?’m trying to add a multi step form and if a user check a checkbox it can be directly redirected to the next step without clicking on next button, but with my scipt the user should click 2 times to go to next step,
    also the data in this case are not collected when hi submit the form because hi did not click next button
    could someone help with this
    this is my code :

    (function($){
    
    $('.next-on-click .forminator-checkbox-label').click(function() {
        $('button.forminator-button.forminator-button-next').trigger('click');
    });
    
    })(jQuery);
    • This topic was modified 3 years, 4 months ago by maryamait123.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @maryamait123

    I hope you are doing good today.

    The reason for this could be the core of the Forminator which needs to see that the next button was clicked in real and then it should sore those data from the previous step. I pinged our Forminator and SLS Team to review your query. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @maryamait123

    I hope you are doing good today.

    We tested the above code and all seems to work fine and we are able to collect data.

    Could you export your Forminator form, upload it to google drive or dropbox, and share a link in your next reply so that we could take a closer look at this?

    Kind Regards,
    Kris

    Thread Starter maryamait123

    (@maryamait123)

    Hello, thank you for your time, this is the page i need help with https://isowatt.fr/test/
    i have to click twice to go to the next step, but i need to click just once.
    also the data not collected because there is some fields can be visible only if i check the first checkbox but there not visible without clicking the next button
    thank you

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @maryamait123

    Could you export your form as mentioned in my last reply, upload it to google drive or dropbox, and share a link in your next reply. This will help us more to review this.

    Kind Regards,
    Kris

    Thread Starter maryamait123

    (@maryamait123)

    here is the link : https://drive.google.com/file/d/1AHS873V9zJuDcqrYdsNxiNsFrSso_sNo/view?usp=sharing

    [ Please do not bump. ]

    • This reply was modified 3 years, 4 months ago by Yui.
    • This reply was modified 3 years, 4 months ago by Jan Dembowski.
    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @maryamait123 ,

    I’m sorry for the delay in response – we didn’t get an email notification about your last response ??

    I’ve checked your code with your form and I was able to replicate the double click issue.
    I’ll check with our second line developers if there is a way to change this with your form.

    kind regards,
    Kasia

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @maryamait123 ,

    Please check this code snippet https://gist.github.com/wpmudev-sls/45e1629ea253386daab3f3600cc4314d
    That should help you achieve your goal.

    Or JS like that:

    (function($) {
    
        $(document).ready(function() {
            setTimeout(function() {
                $('.forminator-custom-form').trigger('after.load.forminator');
            }, 100);
    
            $(document).on('after.load.forminator', function(e, form_id) {
    
                var next_button        = document.querySelector('.forminator-button-next'),
                    click_event        = new CustomEvent('change_evt'),
                    clickable_elements = document.querySelectorAll('.next-on-click .forminator-checkbox-label'),
                    checkboxes         = document.querySelectorAll('.next-on-click input[type="checkbox"]');
    
                clickable_elements.forEach(
                    clickable_element => {
                        clickable_element.addEventListener('click', wpmudev_clickables_event_callback)
                    }
                )
    
                function wpmudev_clickables_event_callback() {
                    if (typeof(next_button) != 'undefined' && next_button != null) {
    
                        checkboxes.forEach(checkbox => {
                            checkbox.addEventListener('change', wpmudev_change_evt_callback)
                        })
                    }
                }
    
                function wpmudev_change_evt_callback(e) {
                    if (e.currentTarget.checked) {
                        next_button.click();
                    }
                }
    
            });
    
        });
    
    })(jQuery);

    kind regards,
    Kasia

    Thread Starter maryamait123

    (@maryamait123)

    @wpmudev-support2 thank youuuuu it’s working like a charm

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘multi step form without click the next button’ is closed to new replies.