eliag88
Forum Replies Created
-
Forum: Plugins
In reply to: [Conditional Fields for Contact Form 7] Skip step via validating field valueHello! Thank you so much for the response!
You’re right, it was firing before the scripts loaded. Even when the form was in the footer, because there was no interaction it was firing too soon. I’m not too familiar with jQuery to manipulate this adequately. The problem is how to fire this only when the user is in a certain step and to avoid continuing ad eternum.
It would be a fantastic addition in the future if you could add a visual way to work this!
So I can fire this on demand once the user clicks “next” based on a field’s value. Can you help me read what step the user is in at the moment, so I can fire only from that step’s number?
http://conditional-fields-cf7.bdwm.be/form-tester/?hash=d48e500314de81987e2c2bb9c0690c28
My call:
<script> (function($){ $form = $('.wpcf7-form'); $form.click(function(e){ const $clickedElement = $(e.target); var ozevselection = document.getElementById('ozev-select').value; if (ozevselection == 'No') { // Can I use any parameter here to know what step the user is on and include it in this if? if ($clickedElement.hasClass('wpcf7cf_next')) { wpcf7cf.multistepMoveToStep($form, 4); return false; } } }); })(jQuery) </script>Thanks again!