• # Exemple

    Posté par . En réponse au message afficher ou cacher des tableaux avec deux "radio button". Évalué à 3.

    Voila une solution écrite rapidement, en espérant que cela pourra t'aider :

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
    <head>
    <title>::</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
    <script type="text/javascript">
    <!--
    function ShowTab (E)
    {
    document.getElementById("tab1").style.display = (E == 1) ? 'block' : 'none';
    document.getElementById("tab2").style.display = (E == 2) ? 'block' : 'none';
    }
    //-->
    </script>

    </head>
    <body>

    <form id="form" action="">
    <div id="form_chk">
    <input type="radio"
    name="TabCheck"
    onclick="ShowTab(1)"
    checked="checked" />

    <input type="radio"
    name="TabCheck"
    onclick="ShowTab(2)" />
    </div>
    </form>

    <div id="tab1">
    Hello world, thois is the first tab
    </div>

    <div id="tab2" style="display: none;">
    2nd tab
    </div>

    </body>
    </html>



    Désolé pour l'indentation, je n'arrive pas à la faire passer ici ... et bonne chance !