Auteur: daniel ((---.fbx.proxad.net)
Date: 07-10-2007 20:11
[ 13 msg ]
|
Bonjour,
J'ai un probleme pour récupèrer une variable en boucle que je rentre dans une fenètre Prompt.
Voici le code il sagit de la variable "a"
Merci d'avance

<html>
<head>
<SCRIPT LANGUAGE=JavaScript>
function calcul()
{
var n=(prompt("Entrez la quantité :",n));
for(i=1 ; i<=n ; i++)
var a=(prompt("Entrez nombres N° :"+i+"" ))
wdow=open("","","height=820,width=450","scrollbars=1");
wdow.document.write("");
wdow.document.writeln("Nombre d'entrée = "+n+"");
wdow.document.writeln("<br>");
for(i=1 ; i<=n ; i++)
{
wdow.document.writeln("<BR>"+"Nombres N° "+i+"","=",++a);
}
}
</SCRIPT>
</head>
<body>
<form name="formu">
<table border="0" width="100%">
<tr>
<td width="33%"></td>
<td width="34%"><center><INPUT TYPE=button ONCLICK="calcul( );" VALUE="Calculer"></center></td>
<td width="33%">
</td></tr></table>
</form>
</body>
</html>
|