Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom pessoal é seguinte to aqui de novo tenho um form de cadastro de cliente eu escolho o tipo de pessoa se fisica e ou se é juridica bom o jurida ta ok mas quando eu seleciono o fisica tem dois campos que ficam oucultos que o sexo, e adata de aniverssario so aparecem na pessoa fisca pessoa juridica nao bom estou usando javascript para esconder e mostrar nao sei se é aqui o topico mas se nao for por favor me redirecione para o correto mas o problema nao ta no javascript mas sim quando eu clico na pessoa fica meu formulario fica desconfigurado vou postar o codigo para que você possa analizar.
<script>
function marcaPessoa(id){
if (id==2){
document.getElementById("ck").value=2
document.getElementById("nome").innerHTML = "<h6><b>* Nome:</b></h6>"
document.getElementById("sobrenome").innerHTML = "<h6><b>* Sobrenome:</b></h6>"
document.getElementById("cpf").innerHTML = "<h6><b>* CPF:</b></h6>"
document.getElementById("rg").innerHTML = "<h6><b>* RG:</b></h6>"
document.getElementById("Cli1").style.display="block"
document.getElementById("Cli2").style.display="block"
alert(document.getElementById("2").style.display+ " " + document.getElementById("1").style.display);
}else{
document.getElementById("ck").value=1
document.getElementById("nome").innerHTML = "<h6><b>* Empresa:</b></h6>"
document.getElementById("sobrenome").innerHTML = "<h6><b>* Responsável:</b></h6>"
document.getElementById("cpf").innerHTML = "<h6><b>* CNPJ:</b></h6>"
document.getElementById("rg").innerHTML = "<h6><b>* Inscrição Estadual:</b></h6>"
document.getElementById("Cli1").style.display="none"
document.getElementById("Cli2").style.display="none"
alert(document.getElementById("1").style.display+ " " + document.getElementById("2").style.display);
}
}
</script>
<form action="cadcliente.asp?str=adicionar" name="frmRegistrar" id="frmRegistrar" method="post" onsubmit="return verifica();">
<table width="93%" border="0" align="right" cellpadding="0" cellspacing="0" style="border-bottom: 1px solid #CCCCCC">
<tr>
<td height="25"><h4 style="margin-left:5px">* Preenchimento obrigatório</h4></td>
</tr>
<tr>
<td height="25"><table width="95%" border="0" cellspacing="3" cellpadding="3" style="margin-top:5px;">
<tr>
<td width="199" height="25" class="h4" style="padding-left:10px;"><h6>Tipo de Cadastro:</h6></td>
<td colspan="3" class="h4"><input type="hidden" id="ck" name="ck" value="1"><input name="tipoPessoa" id="grupo1" type="radio" value="2" onClick="marcaPessoa(1);">Pessoa Jurídica <input name="tipoPessoa" type="radio" value="1" onClick="marcaPessoa(2);">
Pessoa Física </td>
</tr>
<tr>
<td height="25" class="h4" style="padding-left:20px;"><div id="nome"><h6><b>* Nome:</b></h6></div></td>
<td class="h4"><input name="txNome" type="text" class="caixa" id="grupo1" style='width:180px;' OnKeyUp="Somaiuscula('Somaiuscula', 'window.event.keyCode', 'document.frmRegistrar.txNome')" obrig = "sim" nome = "Nome"></td>
<td align="left" class="h4" colspan="2"> </td>
</tr>
<tr>
<td height="25" class="h4" style="padding-left:20px;"><div id="sobrenome"><h6><b>* Sobrenome:</b></h6></div></td>
<td align="left" class="h4"><input name="txSobrenome" type="text" class="caixa" id="grupo1" style="width:180px;" OnKeyUp="Somaiuscula('Somaiuscula', 'window.event.keyCode', 'document.frmRegistrar.txSobrenome')" obrig = "sim" nome = "Sobrenome"></td>
<td align="left" class="h4" colspan="2"> </td>
</tr>
<tr>
<td height="25" class="h4" style="padding-left:20px;"><div id="cpf"><h6>* CPF:</b></h6></div></td>
<td class="h4"><input name="txCpf" type="text" class="caixa" id="txCpf" size="20" onkeyup="numeros('txCpf')" style='width:180px;' obrig = "sim" nome = "Cpf"></td>
<td align="left" class="h4" colspan="2">somente numeros (9999999999)</td>
</tr>
<tr>
<td height="25" class="h4" style="padding-left:20px;"><div id="rg"><h6><b>* RG:</b></h6></div></td>
<td class="h4"><input name="txRg" type="text" class="caixa" id="txRg" size="20" onkeyup="numeros('txRg')" style='width:180px;' obrig = "sim" nome = "Rg"></td>
<td align="left" class="h4" colspan="2">somente numeros (99999999)</td>
</tr>
<tr id="Cli1" style="display:none;">
<td height="25" class="h4" style="padding-left:20px;"><h6><b>Sexo:</b></h6></td>
<td class="h4">
<input name="sexo" id="grupo2" type="radio" value="2" />
Mascolino
<input name="sexo" type="radio" value="1" />
Feminino
</td>
</tr>
<tr id="Cli2" style="display:none;">
<td height="25" class="h4" style="padding-left:20px;"><h6><b>Data aniverssario:</b></h6></td>
<td class="h4"><input name="txNascto" type="text" class="caixa" id="txNascto" size="20" onkeyup="numeros('txRg')" style='width:180px;' obrig = "sim" nome = "Rg"></td>
<td align="left" class="h4" colspan="2">somente numeros (99/99/9999)</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;">
<tr bgcolor="#F4F4F4">
<td width="26" height="26" align="center" style="border-bottom: 1px solid #CCCCCC; border-top:#CCCCCC 1px solid;"> </td>
<td width="214" align="left" class="h4" style="border-bottom: 1px solid #CCCCCC; border-top:#CCCCCC 1px solid;"> </td>
<td width="128" height="26" align="left" class="h4" style="border-bottom: 1px solid #CCCCCC; border-top:#CCCCCC 1px solid;"><input type="button" name="continuar" value="Cadastrar" onclick="Gravar()">
<span class="h4" style="border-bottom: 1px solid #CCCCCC; border-top:#CCCCCC 1px solid;">
<input name="sair" type="button" id="sair" onclick="Gravar()" value="Sasir" />
</span></td>
<td width="360" align="left" class="h4" style="border-bottom: 1px solid #CCCCCC; border-top:#CCCCCC 1px solid;"><div id="gravar"></div></td>
</tr>
</table></td>
</tr>
</table>
</form>Carregando comentários...