0
I have a while, and wanted each loop to be added a different value in name, two select fields.
Ex: First loop first field comes: weekday1
First loop first field comes: weekday2
Does anyone have any idea how I do it?
Down with the code I got:
<?php
$i = 1;
while ($i <= 2) {
?>
<div class="container">
<div class="jumbotron">
<h1>Dados da primeira Criança</h1>
<form action="">
<div class="semanas-e-periodos">
<div class="form-group">
<label for="exampleFormControlSelect1">Semana</label>
<select class="form-control" id="exampleFormControlSelect1" name="semanacrianca1">
<option value="1semana">1º Semana</option>
<option value="2semana">2º Semana</option>
<option value="3semana">3º Semana</option>
<option value="4semana">4º Semana</option>
</select>
</div>
<div class="form-group">
<label for="exampleFormControlSelect1">Semana</label>
<select class="form-control" id="exampleFormControlSelect1" name="qtdcriancas">
<option value="1">1 Criança</option>
<option value="2">2 Crianças</option>
<option value="3">3 Crianças</option>
<option value="4">4 Crianças</option>
<option value="5">5 Crianças</option>
</select>
</div>
</div>
</form>
</div>
<?
$i++;
}
?>
name="weekly child<? php echo $i">
– user60252
ops name="weekly child<? php echo $i ?>">
– user60252
Very good guy worked out, thanks @Leocaracciolo
– Felipe Edwards Vanstocher