Forum de discussion
Forum « Programmation Javascript » (archives)
Re: getElementbyId
Envoyé: 9 octobre 2002, 12h19 par Oznog
<html>
<head>
<title>Test getElementById formulaire</title>
<script type="text/javascript" language="javascript">
<!--
function setTexteSelect() {
var nSelect = "";
nTexte = document.getElementById("fTexte");
nSelect = document.getElementById("fSelect").value;
nTexte.setAttribute("value", nSelect);
}
// End -->
</script>
</head>
<body>
<form name="momFormulaire" id="momFormulaire" action="" method="POST">
<select name="fSelect" id="fSelect">
<option value="111" selected>111</option>
<option value="222">222</option>
<option value="333">333</option>
</select>
</body>
<input type="button" value="TEST" onclick="setTexteSelect();">
<br>
<input type="text" name="fTexte" id="fTexte" >
</form>
</body>
</html>
Ciao
Oznog
Réponses
|