Variable JS dans un input
Bonjour a vous tous,
Voila je cherche a faire passer le valeur JS dans un input d'un formulaire.
J'ai ceci qui m'affiche bien la valeur mais je ne parviens à afficher cette même valeur dans le input de mon formulaire.
voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <html>
<head>
<script type="text/javascript">
<!--
var obj = new ActiveXObject('WScript.Network');
document.write(obj.UserName);
document.getElementById("autoname").value = (obj.UserName);
-->
</script>
</head>
<body>
test :
<form name="valeur" action="http://127.0.0.1/toto/tata.html" method="post">
<input type="text" id="autoname" name="autoname" value=""/> </form>
<br />
<br />
</body>
</html> |
merci pour votre aide.
Onha