Home › Forums › General Issues › On click display a popup with fields from page › Reply To: On click display a popup with fields from page
Hi @fanta00
You need to load the fields values first and save it in Javascript variables. It should be something like this:
<script type="text/javascript">
(function($){
$( document ).ready(function() {
var fieldPage_<?php echo $page; ?> = <?php echo get_field( "text_field", $page ); ?>;
});
})(jQuery);
</script>
You can also use AJAX to load the fields. These pages should give you more idea about it: http://api.jquery.com/jquery.ajax/, https://premium.wpmudev.org/blog/using-ajax-with-wordpress/.
I hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.