Ok, I finally managed to solve that by myself. It is possible thanks to :
-
Create the first field :
<?php while($mb->have_fields_and_multi('types')): $mb->the_group_open(); $mb->the_field('type'); ?> <input type="text" id="<?php $mb->the_name(); ?>" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>" /> <a href="#" class="dodelete button">Remove</a> <?php $mb->the_group_close(); endwhile; ?> <a href="#" class="docopy-types button" style="float: left">Add new</a> <a href="#" class="dodelete-types button" style="float: right">Delete all</a>
-
Create the second batch of fields while using
foreach
to get the data from the first fields and put that in aselect
:<?php while($mb->have_fields_and_multi('details')): $mb->the_group_open(); $mb->the_field('detail_select'); ?> <select name="<?php $mb->the_name(); ?>"> <option value="">Choose...</option> <?php foreach ($meta['types'] as $types) { ?> <option value="<?php echo $types['type']; ?>"<?php $mb->the_select_state($types['type']); ?>><?php echo $types['type']; ?></option> <?php } ?> </select> <?php $mb->the_field('detail_title'); ?> <label>Description</label> <input type="text" id="<?php $mb->the_name(); ?>" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>" /><br /> <a href="#" class="dodelete button">Remove</a> <?php $mb->the_group_close(); endwhile; ?> <a href="#" class="docopy-estate_details button">Add new</a> <a href="#" class="dodelete-estate_details button">Delete all</a>