Jump to content


Photo

Radio Button


  • Faça o login para participar
6 replies to this topic

#1 Solykis Linux

Solykis Linux

    Normal

  • Usuários
  • 69 posts
  • Sexo:Não informado
  • Localidade:Belo Horizonte - MG
  • Interesses:Php, Linux, Software Livre , Mulheres , Festas e o Solykis OS , produzido por min xD.

Posted 03/08/2006, 16:06

Quero fazer um radio button para inscrição de um acampamento.
Fiz o formulário mas puz 2 radios, 1° é IDENTIDADE e 2° é CERTIDÃO DE NASCIMENTO, a pessoa escolhe o documento e aparece o resto do formulário de acordo com o escolhido.
Como faço isso?

Obrigado
<?

phpinfo();

?>

#2 Andreia Regina

Andreia Regina

    Veterano

  • Conselheiros
  • 1347 posts
  • Sexo:Feminino
  • Localidade:PR
  • Interesses:PHP; MySQL; Javascript; CSS; tudo ligado ao desenvolvimento web.

Posted 04/08/2006, 11:06

Olá!

Tenta assim:
<script language="JavaScript">
<!--
	var visibleVar="null";

	if (navigator.appName == "Netscape") {
				layerStyleRef="layer.";
				layerRef="document.layers";
				styleSwitch="";
				visibleVar="show";
	} else {
				layerStyleRef="layer.style.";
				layerRef="document.all";
				styleSwitch=".style";
				visibleVar="visible";
	}

	function showLayer(layerName,layerName2){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+visibleVar+'"');
		eval(layerRef+'["'+layerName2+'"]'+styleSwitch+'.visibility="'+visibleVar+'"');
	}

	function hideLayer(layerName,layerName2){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		eval(layerRef+'["'+layerName2+'"]'+styleSwitch+'.visibility="hidden"');
	}

-->
</script>

			<p>Identidade
			  <input name="identidade" type="radio" value="on" onclick="java script:showLayer('texto1');hideLayer('texto2');"/>
			 <br/>
			 Certidão de Nascimento 
			  <input name="certidao" type="radio" value="on" onclick="java script:onclick="java script:showLayer('texto2');hideLayer('texto1');"/>
			  </p>

			<div id="texto1" style="visibility: hidden;"> Aqui vai o outro conteúdo </div>
			<div id="texto2"> Aqui vai o conteúdo desejado</div>
:unsure: Deve funcionar, qualquer coisa post novamente

Fórum WMO - Conselheira - Na equipe desde 31/01/2006.
Links importantes: Regras de conduta - Busca do fórum


#3 Solykis Linux

Solykis Linux

    Normal

  • Usuários
  • 69 posts
  • Sexo:Não informado
  • Localidade:Belo Horizonte - MG
  • Interesses:Php, Linux, Software Livre , Mulheres , Festas e o Solykis OS , produzido por min xD.

Posted 04/08/2006, 12:40

não deu certo...mas obrigado...se alguém souber respondam por favor.
tenho que acabar o sistema até 2ª
<?

phpinfo();

?>

#4 Andreia Regina

Andreia Regina

    Veterano

  • Conselheiros
  • 1347 posts
  • Sexo:Feminino
  • Localidade:PR
  • Interesses:PHP; MySQL; Javascript; CSS; tudo ligado ao desenvolvimento web.

Posted 04/08/2006, 13:30

Ops, desculpe

Eu alterei uma parte do script mas não alterei na função :(

<script language="JavaScript">
<!--
	var visibleVar="null";

	if (navigator.appName == "Netscape") {
				layerStyleRef="layer.";
				layerRef="document.layers";
				styleSwitch="";
				visibleVar="show";
	} else {
				layerStyleRef="layer.style.";
				layerRef="document.all";
				styleSwitch=".style";
				visibleVar="visible";
	}

	function showLayer(layerName){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+visibleVar+'"');
	}

	function hideLayer(layerName){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
	}

-->
</script>

Fórum WMO - Conselheira - Na equipe desde 31/01/2006.
Links importantes: Regras de conduta - Busca do fórum


#5 Solykis Linux

Solykis Linux

    Normal

  • Usuários
  • 69 posts
  • Sexo:Não informado
  • Localidade:Belo Horizonte - MG
  • Interesses:Php, Linux, Software Livre , Mulheres , Festas e o Solykis OS , produzido por min xD.

Posted 04/08/2006, 14:54

Andreia, não deu :( tenta fazer um arquivo html completo talvez eu que esteja sendo burro hehe..obrigado pela ajuda :)
<?

phpinfo();

?>

#6 Andreia Regina

Andreia Regina

    Veterano

  • Conselheiros
  • 1347 posts
  • Sexo:Feminino
  • Localidade:PR
  • Interesses:PHP; MySQL; Javascript; CSS; tudo ligado ao desenvolvimento web.

Posted 04/08/2006, 16:52

Ai está:

<script language="JavaScript">
<!--
	var visibleVar="null";

	if (navigator.appName == "Netscape") {
				layerStyleRef="layer.";
				layerRef="document.layers";
				styleSwitch="";
				visibleVar="show";
	} else {
				layerStyleRef="layer.style.";
				layerRef="document.all";
				styleSwitch=".style";
				visibleVar="visible";
	}

	function showLayer(layerName){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+visibleVar+'"');
	}

	function hideLayer(layerName){
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
	}
-->
</script>
<form name="form1" method="post" action="">
	 Identidade<input name="opcao" type="radio" value="on" checked onclick="java script:hideLayer('naodestaque');
showLayer('destaque');">
<br/>
	Certidão de Nascimento
<input name="opcao" type="radio" value="off" onclick="java script:hideLayer('destaque');
showLayer('naodestaque');"> 
	<div id="destaque">
	  Informações Identidade </div>
	<div id="naodestaque" style="visibility: hidden">
	  Informações Certidão  </div>
</form>
Testado e funcionando!

Fórum WMO - Conselheira - Na equipe desde 31/01/2006.
Links importantes: Regras de conduta - Busca do fórum


#7 Solykis Linux

Solykis Linux

    Normal

  • Usuários
  • 69 posts
  • Sexo:Não informado
  • Localidade:Belo Horizonte - MG
  • Interesses:Php, Linux, Software Livre , Mulheres , Festas e o Solykis OS , produzido por min xD.

Posted 04/08/2006, 21:15

opa valeu!
assim que o site tiver pronto posto ai
Obrigado Andreia ;)
<?

phpinfo();

?>




2 user(s) are reading this topic

0 membro(s), 2 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq