0
i have the following javascript function:
$(document).ready(function () {
Eventos();
$('[name="dtd1nrob"]').change(function () {
BloquearQuestao();
});
});
function Eventos() {
BloquearQuestao(true);
};
function BloquearQuestao(load) {
load = load || false;
if (!load) {
}
var value = $('[name="dtd1nrob"]:checked').val();
if (value == '1') {
$('[name="dtd1"]').prop("disabled", true);
$('[name="dtd1"]').val('');
} else {
$('[name="dtd1"]').prop("disabled", false);
}
}
The variable dtd1nrob
is a checkbox that when it is selected disables and clears the variable dtd1
, when I select the variable dtd1nrob
and save the form so far everything ok, but when I return in the form, the variable dtd1
is not disabled but the variable dtd1nrob
is selected, someone could help me ?
Question seems quite like this: If Load javascript
– Woss
So it’s the same pretty much just that I went to do the tests today and it didn’t solve, it still comes disabled
– Leonardo Macedo
What is
load
? What you call the functionBloquearQuestao
?– Woss
updated the topic
– Leonardo Macedo
Do
console.log(value)
within the functionBloquearQuestao
and see the values being considered.– Woss
is returning the value 1 name="dtd1nrob" value="1"
– Leonardo Macedo
Let’s go continue this discussion in chat.
– Woss
Okay, I’m already there!
– Leonardo Macedo