Jump to content
Fórum Script Brasil
  • 0

[resolvido] Radios Activos


pukurucha
 Share

Question

Tenho dois radiobutton que estao funcionando mas não perfeitamente, quer dizer quando clico no check singular ele habilita um determinado layer mas quando a seguir volto habilitar o check colectivo ele habilita um outro layer mas os dois radios continuam activo("checados"). O codigo é o seguinte:

<script>

function habilita(){

if (document.getElementById("divcolectivo").style.visibility = 'visible')

{document.getElementById("divcolectivo").style.visibility = 'hidden';

document.getElementById("colectivo").checked == false;

document.getElementById("divsingular").style.visibility = 'visible';

return true;

}

}

function desabilita(){

if (document.getElementById("divsingular").style.visibility = 'visible')

{ document.getElementById("divsingular").style.visibility = 'hidden';

document.getElementById("singular").checked == false;

document.getElementById("divcolectivo").style.visibility = 'visible';

return true;

}

}

</script>

<form action="<?php echo($PHP_SELF); ?>" method="post" name="form1" id="form1" >

<input name="singular" id="singular"type="radio" onClick="habilita()" value="singular">

<input name="colectivo" type="radio" id="colectivo" onClick="desabilita()" value="colectivo">

</form>

Tens alguma idea do que se esta a acontecer?

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
      150.1k
    • Total Posts
      647.1k
×
×
  • Create New...