I've got problem to disable submit button conditionally. My js code is as follows:
function disableButton() {
var btnSubmit = document.getElementById('sub_butt');
if (document.getElementsByName('submitted').value == "yes") {
btnSubmit.disabled = true;
}
else {
btnSubmit.disabled = false;
}
}
In django I have updateForm with formset and I would like to disable button based on value text field with name "submitted". I've tried the code above but nothing's changed. Field "submitted" is already filled out with value 'yes'