Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nic0ps

    (@nic0ps)

    I’ve made an action and a function inside functions.php. Then i run the script inside the function, where you call wpcf7.initForm and reload CF7 conditional fields plugin

    
    add_action('wp_ajax_get_event_form', 'get_event_form');
    add_action('wp_ajax_nopriv_get_event_form', 'get_event_form');
    function get_event_form() {
    
    	/* do your php code, query etc. */
    
    	?>
    	<script>
    		// Init CF7
    		// because is ajax reload wpcf7.initForm
    	
    		jQuery('.wpcf7 > form').each(function () {
    			var $form = jQuery(this);
    			wpcf7.initForm($form);
    			if (wpcf7.cached) {
    				wpcf7.refill($form);
    			}
    		});
    
    		//load cf7 conditional fields at the end
    		jQuery.getScript('../../../wp-content/plugins/cf7-conditional-fields/js/scripts.js', function () {
    		});
    
    	</script>
    	<?php
    	wp_die();
    }

    In the input “number” there’s a select with option “slider”.

    Is that what you need?

Viewing 2 replies - 1 through 2 (of 2 total)