You can make an event, when you enter age, if it is less than 18 the fields of Father and Mother change to required
HTML:
<input type="text" name="idade" id="idade" required>
<label for="idade">Idade</label>
<input type="text" name="mae" id="mae">
<label for="mae">Mãe</label>
<input type="text" name="pai" id="pai">
<label for="pai">Pai</label>
JS:
var campoIdade = document.getElementById('idade');
campoIdade.onchange = function() {
var idade = campoIdade.value;
if(idade < 18) {
document.getElementById('mae').required = true;
document.getElementById('pai').required = true;
} else {
document.getElementById('mae').required = false;
document.getElementById('pai').required = false;
}
}
So every time the age is entered, the check is made, and the parent's property is changed to mandatory if you are under 18.
Running here: link
Hope it helps