7
I need, in certain situations, to enable a checkbox or not. I made a Javascript function and I can’t enable/disable it. Here is the function:
function ValidaCampoInserirAutorizacao(){
var vTussMed = document.getElementById('ind_tipo_mat_med_hid').value;
var vSituacao = document.getElementById('ind_situacao_hid').value;
var vClassif = document.getElementById('cod_grupo_mat_med_hid').value;
var vGrupEst = document.getElementById('cod_grupo_estatistico_hid').value;
if(vTussMed == '5' && vClassif == '998' && vGrupEst == 'MED' && vSituacao == 'A'){
document.getElementById('ind_permite_inc_autori_chkb').enable = true;
}else{
document.getElementById('ind_permite_inc_autori_chkb').enable = false;
}
}
This function is called in the events onchange
of radiobutton
s and two select
's.
Here we have the answer! As recommended by the W3 website: http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_checkbox_disabled2
– Not The Real Hemingway