Support

Account

Home Forums Front-end Issues Frontend WYSIWYG Problems Reply To: Frontend WYSIWYG Problems

  • Maybe it is worth more information, but I understand that “live” triggers are able to be used on DOM elements populated after the page has loaded. Likewise, I have set up some working code in order to close this created popup when the newly created ACF form is submitted.

    Also here is a helpful example for other users viewing this forum to submit their acf form with jQuery – works very nicely.

    $( "#acf-ajax-form" ).live( "submit", function( event ) {
        event.preventDefault();
    
        $(this).find('input[type=submit]').attr("disabled", true).val("Processing...");
    
        var formData = $(this).serialize();
        var formUrl = formData.return;
    
        $.post(formUrl, formData, function(response) {
            // Close the popup container
            $('#my-popup-container').foundation('reveal', 'close' );
    
            // Clear the HTML
            $('#my-popup-container').html('');
        });
    });

    Is there a way in which we might perform the jQuery trigger that you suggested above (acf/setup_fields) to mimic the “live” event?