Support

Account

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.