Utiliser un bouton radio et une balise select

ViPHP
ViPHP | 656 Messages

30 sept. 2006, 00:30

Voici comment je te propose de présenter ton formulaire :

Code : Tout sélectionner

<html> <head> <title>Selection OS</title> <script type="text/javascript"> <!-- function emptyIt(who) { if (who.value == "Précisez...") { who.value = ""; } } function disableSelect() { document.getElementById("customID").disabled = false; document.getElementById("selectID").disabled = true; } function disableCustom() { document.getElementById("customID").disabled = true; document.getElementById("selectID").disabled = false; if (document.getElementById("customID").value == "") { document.getElementById("customID").value = "Précisez..."; } } //--> </script> </head> <body> <form name="selectOS"> <div> <label><input type="radio" name="customize" value="select" checked="checked" onChange="javascript:disableCustom();">Choisissez :</label> <select id="selectID"> <option name="windows">Windows</option> <option name="linux">Linux</option> <option name="macintosh">Macintosh</option> <option name="solaris">Solaris</option> </select> </div> <div> <label><input type="radio" name="customize" value="custom" onChange="javascript:disableSelect();">Autre :</label> <input type="text" name="cutomefield" value="Précisez..." onClick="javascript:emptyIt(this);" id="customID" disabled="disabled"> </div> </form> </body> </html>

Eléphant du PHP | 199 Messages

02 oct. 2006, 14:04

Tu as donc fait la methode de priorite du champ de saisie par rapport
a ta liste select. C'etait ma premiere idee.
Est-ce que ton probleme est resolu ???
oui c'est bon le probleme est resolu

et pour repondre a Ultiny, je ne peut pas utiliser ta solution, car j'utilise un include,uniquement le corps de ma page change ...