Home › Forums › General Issues › Problem with a repeater field (select + number field) › Reply To: Problem with a repeater field (select + number field)
Hi thanks for your answer it’s kind of acf problem because i don’t know how to get the field that is number with the select field
`<?php if(get_field(‘representation’)): ?>
<?php while(has_sub_field(‘representation’)): ?>
<input type=”checkbox” id=”<?php echo $i ;?>” name=”date[]” value=”<?php the_sub_field(‘date_where’); ?>” /><?php the_sub_field(‘date_where’); ?> – <?php the_sub_field(‘lieu_concert’); ?>
<?php
// vars
$select = get_sub_field_object(‘categorie_age’);
$value = get_sub_field(‘categorie_age’);
?>
<select name=”sele-personne”>
<?php foreach( $select[‘choices’] as $k => $v ): ?>
<option>
<?php if( $k == $value ): ?>
<span class=”selected”>Selected!</span>
<?php endif; ?>
<?php echo $v ; ?>
</option>
<?php endforeach; ?>
</select>
<!– It doesn’t work … –>
<input type=”texte” readonly value=”<?php the_sub_field(‘place_and_price’); ?>” />
<!– It doesn’t work … –>
<?php endwhile; ?>
<?php endif; ?>
this is my result :
<input type=”checkbox” id=”1″ name=”date[]” value=”Samedi 14 Décembre 2013, 20h”> Samedi 14 Décembre 2013, 20h
<select name=”sele-personne”>
<option>
Cat 1 – Adulte
</option>
<option>
Cat 2 – Adulte
</option>
<option>
Cat 3 – Adulte
</option>
<option>
Cat 1 – Etudiant
</option>
<option>
Cat 2 – Etudiant
</option>
<option>
Cat 3 – Etudiant
</option>
<option>
Cat 1 – Enfant
</option>
<option>
Cat 2 – Enfant
</option>
<option>
Cat 3 – Enfant
</option>
</select>
<input type=”texte” id=”place_and_price” readonly value=”” />
<!– i want when i select a item to get the sub_filed (place_and_price) in the input –>
`
This how it is in the admin
You can add a categorie -> exemple Cat – Adulte then the price for it place_and_price 20 $
But here on my result i don’t see the price the input is still empty ( i would know how to get it and load correctly with the categorie i have selected
thanks in advance
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.