Radio Button
#1
Posted 03/08/2006, 16:06
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
Posted 04/08/2006, 11:06
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>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
Posted 04/08/2006, 12:40
tenho que acabar o sistema até 2ª
<? phpinfo(); ?>
#4
Posted 04/08/2006, 13:30
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
Posted 04/08/2006, 14:54
<? phpinfo(); ?>
#6
Posted 04/08/2006, 16:52
<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
Posted 04/08/2006, 21:15
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)