-1
The code is working if you fill in the input
directly and when it is receiving the values dynamically it does not disable, only when I click on it.
var btn = document.getElementById("btn");
var tvalor = document.getElementById("tvalor");
tvalor.addEventListener('keyup', (e) => {
btn.setAttribute('disabled', 'disabled');
const n0 = isNaN(tvalor.value.replace(',','.')) === false;
const n1 = parseFloat(tvalor.value.replace(',','.'));
const n2 = typeof n1 === 'number' && isFinite(n1);
if (n0 && n1 && n2 && n1 >= 13) {
btn.removeAttribute('disabled');
}
});
<form>
<input type="text" id="tvalor">
<input type="submit" id="btn" disabled>
</form>
Put in question the function that injects the values dynamically, and there you need to make it happen.
– Rogerio Santos
They are by checkbox when clicking on the checkbox they play the value in total
– Rafa
Show to us.
– Rogerio Santos
I posted there!.....
– Rafa
Could you help me friend? just need this code to finish my project!
– Rafa
Just need to show how these dynamic values are passed and retrieved there in your code.
– user60252
put an option with checkboxes in my reply
– user60252