• [^] # Re: voici

    Posté par . En réponse au message javascript et XHTML. Évalué à 1.

    Ca ne fonctionne pas. Voici les fichiers dont je me sert pour mes tests :


    =====index.xhtml======
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Sommaire en PHP !</title>



    </head>

    <body>
    <script language="javascript" src="script.js"/>
    <div id="sommaire">
    <h3>Sommaire</h3>
    <a href="#" onClick="ShowPage(1)">Page 1</a><br/>
    <a href="#" onClick="ShowPage(2)">Page 2</a><br/>
    <a href="#" onClick="ShowPage(3)">Page 3</a><br/>
    <a href="#" onClick="ShowPage(4)">Page 4</a><br/>
    </div>

    <div id="page">
    </div>
    <form id="formulaire">
    <input id="textfield" type="text" value=""/>
    </form>
    </body>
    </html>


    ======script.js=======
    function ShowPage(page)
    {
    document.forms["formulaire"].elements["textfield"].value="NOUVEAU"
    }