0
I have a registration form for dependents of a plan, where you can choose son, husband, father-in-law, etc. and then the year of birth
He wanted, when selecting what the degree of kinship, he go changing the options of select, ex:
Selecionar filho: Máximo ano atual | Mínimo - 35 anos (1982 a 2017)
Pai/mãe: Máximo ano atual - 12 | Mínimo ano atual - 100 (1917 a 2005)
Outros: Máximo ano atual | Mínimo ano atual - 100 (1917 a 2017)
Can use php, javascript, jquery, qq a.
I was only able to create a rule, I don’t know how to attach to the other select:
<select id="grau_parentesco">
<option value="filho">Filho(a)</option>
<option value="pai">Pai</option>
<option value="mae">Mãe</option>
<option value="outros">Outros</option>
</select>
<select id="ano"></option>
<?
$ano_inicial = date("Y");
$qtd = 35;
for($i=0; $i <= $qtd; $i++){
$ano = $ano_inicial-$i;
$ano = sprintf("%02s",$ano);
echo "<option value=\"".$ano."\">".$ano."</option>\n";
}
?>
</select>
You mean thus?
– BrTkCa
Or this: https://answall.com/a/14668/43731
– tkmtts
exactly, but the difference is that I need you to run the years automatically, so that no matter what year we’re in, he does it every year, so that I don’t have to change the code every year
– Leandro Marzullo