• 0
Sign in to follow this  
Guest Ferraz

Mudar O Nome Do Campo


Guest Ferraz

Como fazer para mudar o nome de um campo automática, por exemplo pessoa fisica e pessoa juridica, quando for juridica parecer no campo CNPJ e quando for pessoa Fisica CPF. OBS eu vou escolher o tipo de pessoa em um combo...


Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Teste este código:


<script type="text/javascript" language="javascript">
	function mudaLabel(pValor) {
  if (pValor == -1) return false;
  if (pValor == 1) {
  	lbl1.innerHTML = "Pessoa Física";
  else {
  	lbl1.innerHTML = "Pessoa Jurídica";

	<form name="frm1" id="frm1" action="teste.asp" method="post" onSubmit="javascript:return validaCampo();">
  <select name="cmb1" id="cmb1" onChange="javascript:mudaLabel(this.value);">
  	<option value="-1">Escolha uma opção</option>
  	<option value="1">Física</option>
  	<option value="2">Jurídica</option>
  <br /><br />
  <span name="lbl1" id="lbl1">Texto Inicial</span>
  <br /><br />
  <input type="submit" name="btn1" id="btn1" value="Enviar">

Share this post

Link to post
Share on other sites

Join the conversation

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

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.

Sign in to follow this