Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

razs

hide/show

Recommended Posts

Boas pessoal, tenho uma div que esta defenida como hide e ao clicar no butao ele altera para visivel mas nao sei porque apenas um funciona.

 

<b><input type="checkbox" class="olhos" name="od" value="1" onchange="var id = document.getElementById('Boxtb'); if(id.style.display == 'block'){ id.style.display = 'none'; id.style.visibility = 'hidden';} else{ id.style.display = 'block'; id.style.visibility = 'visible';}">OD</b>
<p class="clear">
<b><input type="checkbox" class="olhos" name="os" value="1" onchange="var id = document.getElementById('Boxtc'); if(id.style.display == 'block'){ id.style.display = 'none'; id.style.visibility = 'hidden';} else{ id.style.display = 'block'; id.style.visibility = 'visible';}">OS</b>
</div>
<p class="clear">
<div id="Boxtb"><h3>OD</h3></div> 
<div id="Boxtc"><h3>OS</h3></div> 
<br>
<h3>CFP</h3>
<p class="clear">
<div id="Boxta"><label>FR</label></div>
<div id="Boxtb"><input type="text" name="checkFRod"></div>
<div id="Boxtc"><input type="text" name="checkFRos"></div>

 

nao sei porque ele mostra o OD e OS mas nao mostra os inputs?

Compartilhar este post


Link para o post
Compartilhar em outros sites

so acho estranho que o OD e OS incial apareca normalmente enquanto o resto nao aparece.

 

<div id="olhos">
<p class="clear">
<b><input type="checkbox" class="olhos" name="od" value="1" onchange="var id = document.getElementById('Boxtb'); if(id.style.display == 'block'){ id.style.display = 'none'; id.style.visibility = 'hidden';} else{ id.style.display = 'block'; id.style.visibility = 'visible';}">OD</b>
<p class="clear">
<b><input type="checkbox" class="olhos" name="os" value="1" onchange="var id = document.getElementById('Boxtc'); if(id.style.display == 'block'){ id.style.display = 'none'; id.style.visibility = 'hidden';} else{ id.style.display = 'block'; id.style.visibility = 'visible';}">OS</b>
</div>
<p class="clear">
<div id="Boxta"><h3>Exam</h3></div> 
<div id="Boxtb"><h3>OD</h3></div> 
<div id="Boxtc"><h3>OS</h3></div> 
<br>
<h3>CFP</h3>
<p class="clear">
<%'if rs.fields("checkFR_grad")="1" then
%>
<div id="Boxta"><label>FR</label></div>
<div id="Boxtb"><input type="text" name="checkFRod"></div>
<div id="Boxtc"><input type="text" name="checkFRos"></div>
<%'end if
'if rs.fields("checkF1M_grad")="1" then 
%>
<p class="clear">
<div id="Boxta"><label>F1M</label></div>
<div id="Boxtb"><input type="text" name="checkF1Mod"></div>
<div id="Boxtc"><input type="text" name="checkF1Mos"></div>
<%'end if
'if rs.fields("checkF2_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F2</label></div>
<div id="Boxtb"><input type="text" name="checkF2od"></div>
<div id="Boxtc"><input type="text" name="checkF2os"></div>
<%'end if
'if rs.fields("checkF3M_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F3M</label></div>
<div id="Boxtb"><input type="text" name="checkF3Mod"></div>
<div id="Boxtc"><input type="text" name="checkF3Mos"></div>
<%'end if
'if rs.fields("checkF4_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F4</label></div>
<div id="Boxtb"><input type="text" name="checkF4od"></div>
<div id="Boxtc"><input type="text" name="checkF4os"></div>
<%'end if
'if rs.fields("checkF5_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F5</label></div>
<div id="Boxtb"><input type="text" name="checkF5od"></div>
<div id="Boxtc"><input type="text" name="checkF5os"></div>
<%'end if
'if rs.fields("checkF6_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F6</label></div>
<div id="Boxtb"><input type="text" name="checkF6od"></div>
<div id="Boxtc"><input type="text" name="checkF6os"></div>
<%'end if 
'if rs.fields("checkF7_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F7</label></div>
<div id="Boxtb"><input type="text" name="checkF7od"></div>
<div id="Boxtc"><input type="text" name="checkF7os"></div>
<%'end if 
'if rs.fields("check50F1M_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F7</label></div>
<div id="Boxtb"><input type="text" name="check50_F1Mod"></div>
<div id="Boxtc"><input type="text" name="check50_F1Mos"></div>
<%'end if  
'if rs.fields("check50F2_grad")="1" then
%><p class="clear">
<div id="Boxta"><label>F7</label></div>
<div id="Boxtb"><input type="text" name="check50_F2od"></div>
<div id="Boxtc"><input type="text" name="check50_F2os"></div>
<%'end if
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara. Eu tirei os scripts ASP do seu código e funcionou beleza...

Nos seus IF's eu percebi que você compara o field com um valor numericos entre aspas, como se fosse string. Tire essas aspas e veja se funciona.

 

O field que você compara deve estar retornando um inteiro...

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.