Na função só incluir tah funcionando,
Ola Galera no código abaixo somente o incluir está funcionando, quando clico nele as outras três opções são desabilitadas e o focus vai para o CAMPO2 certo. Preciso que quando seja clicado em CANCELAR seja limpado todos os campos e todas as opções (INCLUIR, ALTERAR e EXCLUIR) voltem a ficar habilitadas. ALguem ajuda ???
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""[http://www.w3.org/TR/html4/loose.dtd">](http://www.w3.org/TR/html4/loose.dtd%22)<html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript1.2" src="geral.js"></script><script Language="JavaScript"><!--function novo(){ document.forms[0].alterar.disabled = true; document.forms[0].excluir.disabled = true; document.forms[0].CAMPO2.disabled = false; document.forms[0].CAMPO3.disabled = false; document.forms[0].CAMPO7.disabled = false; document.forms[0].CAMPO8.disabled = false; document.forms[0].CAMPO9.disabled = false; document.forms[0].CAMPO10.disabled = false; document.forms[0].CAMPO11.disabled = false; }function alterar(){ document.forms[0].incluir.disabled = true; document.forms[0].alterar.disable = true; document.forms[0].excluir.disabled = true; document.forms[0].CAMPO2.disabled = false; document.forms[0].CAMPO3.disabled = false; document.forms[0].CAMPO7.disabled = false; document.forms[0].CAMPO8.disabled = false; document.forms[0].CAMPO9.disabled = false; document.forms[0].CAMPO10.disabled = false; document.forms[0].CAMPO11.disabled = false; }function excluir(){ document.forms[0].incluir.disabled = true; document.forms[0].alterar.disabled = true; document.forms[0].cancelar.disabled = true; document.forms[0].CAMPO2.disabled = false; document.forms[0].CAMPO3.disabled = false; document.forms[0].CAMPO7.disabled = false; document.forms[0].CAMPO8.disabled = false; document.forms[0].CAMPO9.disabled = false; document.forms[0].CAMPO10.disabled = false; document.forms[0].CAMPO11.disabled = false; }function cancelar(){ document.forms[0].incluir.disabled = true; document.forms[0].alterar.disabled = true; document.forms[0].excluir.disabled = true;}//--></script></head><body><form name="form1" method="post" action="[http://localhost/acao_pgcad"](http://localhost/acao_pgcad) onSubmit="return valida();"><TABLE cellSpacing=1 cellPadding=1 width=600 align=center border=0><TD><br><table width="70%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><input name="incluir" type="button" class="button" id="incluir" value="Incluir" onClick="novo(); document.form1.CAMPO2.focus()"></td><td><input name="alterar" type="button" class="button" id="alterar" value="Alterar" onClick="alterar(); document.form1.CAMPO2.focus()"></td><td><input name="excluir" type="reset" class="button" id="excluir" value="Excluir" onClick="excluir();"></td><td><input name="cancelar" type="reset" class="button" id="cancelar" value="Cancelar" onClick="cancelar();"></td></tr></table><br><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="10%">Campo1<br><input name="CAMPO1" type="text" class="button1" size="5" onFocus="this.blur()"></td><td width="40%">Campo2<br><input name="CAMPO2" type="text" class="button" disabled="true" tabindex="1" size="35" onKeyDown="java script: entertab();"></td><td width="41%">Campo3<br><input name="CAMPO3" type="text" class="button" id="CAMPO3" disabled="true" tabindex="2" size="35" onKeyDown="java script: entertab();"></td><td width="9%">Campo4<br><input name="CAMPO4" type="text" id="CAMPO4" size="5" class="button1" onFocus="this.blur()"></td></tr></table><br><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="41%">Campo5<br><input name="CAMPO5" type="text" id="CAMPO5" size="3" class="button" value="C" onFocus="this.blur()"></td><td width="13%">Campo6<br><input name="CAMPO6" type="text" id="CAMPO6" size="3" class="button" value="S" onFocus="this.blur()"> </td><td width="18%">Campo7<br><input name="CAMPO7" type="text" id="CAMPO7" size="3" disabled="true" tabindex="3" class="button" onKeyDown="java script: entertab();"></td><td width="15%">Campo8<br><input name="CAMPO8" type="text" id="CAMPO8" disabled="true" size="11" tabindex="4" class="button1" onblur="DateFormat(this,this.value,event,true,'3')" onkeyup="DateFormat(this,this.value,event,false,'3')" onfocus='vDateType="3";' onKeyDown="java script: entertab();"></td><td width="13%">Campo9<br><input name="CAMPO9" type="text" id="CAMPO9" disabled="true" size="11" tabindex="5" class="button1" onblur="DateFormat(this,this.value,event,true,'3')" onkeyup="DateFormat(this,this.value,event,false,'3')" onfocus='vDateType="3";' onKeyDown="java script: entertab();"></td></tr></table><br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>Campo10<br><textarea name="CAMPO10" cols="94" rows="5" disabled="true" tabindex="6" class="button" id="CAMPO10" onKeyDown="java script: entertab();"></textarea></td></tr></table><br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>Campo11<br><input name="CAMPO11" type="text" id="CAMPO11" disabled="true" tabindex="7" size="50" class="button" onKeyDown="java script: entertab();"></td></tr></table></td></tr></table></form></body></html>Discussão (1)
Carregando comentários...