I have the following function in javascript:
$(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 it disables and clears the variable dtd1
, when I select the variable dtd1nrob
and save the form until everything is ok, but when I come back on the form, the variable dtd1
is not disabled but the dtd1nrob
variable is selected, could someone help me?