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>