Wordpress Select Option Load Custom Fields

I created a new post type called Programs and i created custom fields on Programs width Advanced Custom Fields plugin. I want to compare the Programs fields with each other on the page width select option.

Like this;

I brought the program names to the select section.

div class=ud-program-check__table-header-item
                    ?php
                    $posts = get_posts (array (
                        'numberposts' = -1,   // -1 returns all posts
                        'post_type' = 'programs',
                        'orderby' = 'title',
                        'order' = 'ASC'
                    ));
                ?
                select id=my_great_select name=my_great_select
                    ?php foreach ($posts as $post): ?
                        option id=?php echo $post-ID; ? value=?php echo $post-post_title; ??php echo $post-post_title; ?/option
                    ?php endforeach; ?
                /select
                /div

but I don't know how to fetch the custom fields every time a selection is made (width ajax and javascript).

I want the selected program information to load in the table below;

div class=ud-program-check__table-item
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--bg-gray/div
                    div class=ud-program-check__table-item-container/div
                    div class=ud-program-check__table-item-container ud-program-check__table-item-container--button ud-program-check__table-item-container--bg-gray
                        a href=# class=ud-btn ud-btn--program-checkGet Started
                            div class=ud-btn__icon
                                img src=assets/icons/right-arrow.png class=ud-btn__icon-img
                            /div
                        /a
                    /div
                /div

Can you help me please?

Topic ajax jquery options Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.