Support

Account

Home Forums ACF PRO Loading field on front-end on button click? Reply To: Loading field on front-end on button click?

  • I expect something like this would do the trick:

    <button class="load-video-button" data-video-embed="<?php echo htmlspecialchars(get_field('oembed_video_url')) ?>">Load Video</button>
    <div class="video-container"></div>
    
    <script>
    $(function() {
    
      $('.load-video-button').click(function() {
        $('.video-container').html($(this).data('video-embed'));
      });
    
    });
    </script>

    (I assume you’re using jQuery here.)