Tenho um pequeno problema, tenho um combo que habilita um campo input ou desabilita, porém quando entra na página ele vem habilitado sendo que teria que vir desabilitado.
ta ai o combo e o campo<h:selectOneMenu id="selectId" value="#{cancelarMatriculaList.motivoCancelamentoMatricula}"
disabled="#{empty cancelarMatriculaList.resultList}" onchange="isHabilitaMotivo('10');" styleClass="medio">
<s:selectItems var="o" label="#{o.nome}" value="#{cancelarMatriculaList.listaMotivos}"
noSelectionLabel="#{messages['select']}" hideNoSelection="true"/>
<s:convertEntity />
</h:selectOneMenu>
<h:inputText id="idOutroMotivo" value="#{cancelarMatriculaList.cancelamentoMatricula.outroMotivo}" required="false"/>
o javascript é
function isHabilitaMotivo(descricao){
var obj = document.getElementById('formulario:motivoField:selectId');
var select = obj.options[obj.selectedIndex]
if(select.value == descricao){
document.getElementById('formulario:motivoField:idOutroMotivo').disabled = false;
return true;
}
document.getElementById('formulario:motivoField:idOutroMotivo').disabled = true;
document.getElementById('formulario:motivoField:idOutroMotivo').value='';
}