Home › Forums › Front-end Issues › Select field based on other fields value › Reply To: Select field based on other fields value
UPDATE
So I’ve managed to display the repeater field as a select box with the following code
<select name="cars" id="cars">
<?php
// Check rows existexists.
// Loop through rows.
while( have_rows('yacht_type1') ) : the_row();
// Load sub field value.
$sub_value = get_sub_field('name');
// Do something...
echo '<option value="'.$sub_value.'">'.$sub_value.'</option>';
endwhile;
?>
</select>
Now what I’m actually searching for is how to get and store the value from the select box.
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.