Olá,
como poderia fazer no javascript para desabilitar os campos conforme
abaixo alguém poderia me ajudar …
abs
<h:panelGrid columns="2" >
<h:panelGroup>
<h:outputLabel value="* Verifica"/>
<h:selectBooleanCheckbox id="temporario" value="#{teste.temporario}" title="" />
</h:panelGroup>
</h:panelGrid>
<h:panelGrid width="495px" bgcolor="" columns="2" border="0">
<h:outputText value="Codigo:" />
<h:panelGroup>
<h:inputText id="matriculaFunc" value="#{teste.matriculaFunc}"
required="true" requiredMessage=" Matricula Obrigatória"
validatorMessage=" Matricula tem que ter mais de 3 caracteres">
<f:validateLength minimum="3" />
</h:inputText>
<rich:message for="matriculaFunc" />
</h:panelGroup>
<h:outputText value="Nome:" />
<h:panelGroup>
<h:inputText id="nomeFunc" value="#{teste.nomeFunc}"
required="true" requiredMessage=" Nome Obrigatório."
validatorMessage="Nome tem que ter mais de 3 caracteres">
<f:validateLength minimum="3" />
</h:inputText>
<rich:message for="nomeFunc" />
</h:panelGroup>
<script type="text/javascript">
function temp(obj) {
if(obj.checked == true){
// desabilita campos usuario
document.getElementById("matriculaFunc").disabled = true;
document.getElementById("matriculaFunc").style.background = "#CCC";
document.getElementById("nomeFunc").disabled = true;
document.getElementById("nomeFunc").style.background = "#CCC";
document.getElementById("nivelFunc").disabled = true;
document.getElementById("nivelFunc").style.background = "#CCC";
document.getElementById("nivelFunc").disabled = true;
document.getElementById("nivelFunc").style.background = "#CCC";