Jump to content
Fórum Script Brasil
  • 0

Mudar Campos Do Meu Form


marvi
 Share

Question

Ola pessoal,

tenho um script que muda alguns campos de um formulario quando você clica no botão, só que ele roda normal no IE, mas no firefox fica todo errado o formulario... eu uso isso para opção de pessoa física e juridica no form, como desse site http://www.iphotel.com.br/parceiro_comissionado.asp só que o dele roda no firefox e o meu não...como resolver?

veja o código:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function MudaPessoa(tipo)
{
  if (tipo == "F")
  {
     document.getElementById("juridica").style.display = 'none';
  }
  else
  {
    document.getElementById("juridica").style.display = 'block';
  }
}

</script>
</head>

<body>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><h5>Preencha corretamente o cadastro. </h5></td>
      </tr>
      <tr>
        <td><h5>
<input name="tipo_pessoa" type="radio" value="F" checked onClick="java script: MudaPessoa('F');" /> 
Pessoa F&iacute;sica
<input name="tipo_pessoa" type="radio" value="J" onClick="java script: MudaPessoa('J');" />
Pessoa Jur&iacute;dica </h5></td>
        </tr>
      <tr>
        <td><form id="form2" name="form2" method="post" action="enviar.asp">
          <table id="fisica" style="display:block;" width="100%" border="0" cellspacing="2" cellpadding="2">

            <tr><!-- alterar aqui para exibir PJ -->
              <td colspan="2" align="left" valign="top"> <table width="100%" cellpadding="0" cellspacing="0" id="juridica" style="display:none;">
          <tr>
            <td width="22%"><div align="left">CNPJ: </div></td>
            <td width="78%"><div align="left">
              <input name="frm_cnpj" type="text" id="frm_cnpj" maxlength="18" size="20" />
              <span id="retorna_cnpj"></span></div></td>
          </tr>
          <tr>
            <td><div align="left">Raz&atilde;o Social: </div></td>
            <td><div align="left">
              <input name="frm_razao" type="text" id="frm_razao" size="30" />
              </div></td>
            </tr>
              </table></td>
              </tr>
            <tr>
              <td width="22%"><div align="left">Nome:</div></td>
              <td width="78%"><div align="left">
                <input name="frm_nome" type="text" id="frm_nome" size="30" />
               
              </div></td>
            </tr>
            <tr>
              <td><div align="left">Email:</div></td>
              <td><div align="left">
                <input name="frm_email" type="text" id="frm_email" size="30" />
              <span id="retorna_email"></span></div></td>
            </tr>
            <tr>
              <td><div align="left">Senha:</div></td>
              <td><div align="left">
                <input name="frm_senha" type="password"  id="frm_senha" size="14" maxlength="12" />
              </div></td>
            </tr>
            <tr>
              <td><div align="left"></div></td>
              <td><div align="left">
                <input name="bt_cadastro" type="submit" id="bt_cadastro" value="Enviar" />
              </div></td>
            </tr>
          </table>
         
                </form>        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        </tr>
    </table>
</body>
</html>

Obrigado!

Marcelo

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...