comme ca tu verrasCode:
1
2
3
4
5
6
7
8 <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ alert(i); } } </script>
Version imprimable
comme ca tu verrasCode:
1
2
3
4
5
6
7
8 <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ alert(i); } } </script>
Slt,j'suis dsl,mais sa ne marche pas,je dois pas etre trés doué,mon action ne se repete qu'une seul fois malgré le nombre noter.
Que puis je faire pour m'en sortir? merci .Vins.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 <html> <head> <title>Yahoo! Racing Manager</title> </head> <script language='Javascript'> window.resizeTo(370,250); </script> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ nombre de tours parcourru; } } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <input type="hidden" name="action" value="akFahreTrainingsrunde" /> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="150" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ <option value="4">Dépassements <option value="5">Prog complet <option value="6">Arrêt au stand <option value="7">Freins <option value="8">Seuil <option value="9">Motricité <option value="10">Aérodynamique <option value="11">Optim du moteur <option value="12">Optim du châssis <option value="13">Reco de la piste </select></td> <td width="50" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" onclick="doSomething()" /> </td> </tr> </table></td> </tr> </form> </table> </div> </body> </html>
J'ai remarquer que le mot en value était trés important,que si je supprimer,mon action ne marcher carrement plus.Code:<input type="hidden" name="action" value="akFahreTrainingsrunde" />
Es ce que je dois le rajouter a mon script?
Merci . Vins .[/quote]
explique moi en clair ce que tu veux faire ....
j'ai toujours pas compris,
En faite,c'est un jeu auquel je joue sur yahoo,et moi je veux regrouper toutes les commandes sur une meme page.Le plus gros est fait,mais je cherche juste a le rendre encore plus rapide et pratique..et je viens de me rendre compte que la value noter plus haut c'est elle qui fait tout apparement(si elle ni est pas,mon input ne marche pas),c'est elle je pense que je dois multiplier par le nombre voulu.Code:<input type="hidden" name="action" value="akFahreTrainingsrunde" />
Merci . Vins .
en gros tu voudrais le faire "apparaitre" 10 fois ton input hidden ?
en faite,je sais pas si c'est ce qui faut faire..
Je sais que mon action ne peut pas se repeter plus de 100 fois (ouf)
mais je dois le mettre autant de fois,sa va prendre pas mal de place..
si sa marche tant mieux..
Y a pas moyen de mettre une variable a coté de cette value qui retourne vers le script?
Merci .Vins.
et dans la pageCode:
1
2
3
4
5
6
7 for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "hidden"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions'.appendChild(inp); }
ca t en mettra x dans le div ;)Code:
1
2
3 <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <div id="actions"></div> ....
Bonjour!!
Voilà en gros ce que sa doit donner;je l'ai éssayer,mais sa ne fonctionne tjrs pas,dois-je y rajouter une fonction de temps?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Yahoo! Racing Manager</title> </head> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "hidden"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions'.appendChild(inp); } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <div id="actions"> <input type="hidden" name="action" value="akFahreTrainingsrunde" /> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="160" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ </select></td> <td width="40" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" onclick="doSomething()" /> </td> </tr> </table></td> </tr> </div> </form> </table> </div> </body> </html>
Merci .Vins.
(PS: Bonne fete a tous)
graphiquement, tu verras pas ce que ca donne puisque c est un input type hidden, pour faire le test met text au lieu de hidden et tu verras ce que ca fais.
Bonjour
Sa ne fonctionne pas non plus en mettant text a la place de hidden.Citation:
Envoyé par siddh
Que faire?
Merci .Vins.
montre ton code
Bonjour!!
Voilà le code:
Merci .Vins.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 <html> <head> <title>Yahoo! Racing Manager</title> </head> <script language='Javascript'> window.resizeTo(490,250); </script> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "hidden"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions'.appendChild(inp); } } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <div id="actions"> <input type="hidden" name="action" value="akFahreTrainingsrunde" /> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="160" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ <option value="4">Dépassements <option value="5">Prog complet <option value="6">Arrêt au stand <option value="7">Freins <option value="8">Seuil <option value="9">Motricité <option value="10">Aérodynamique <option value="11">Optim du moteur <option value="12">Optim du châssis <option value="13">Reco de la piste </select></td> <td width="40" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" onclick="doSomething()" /> </td> </tr> </table></td> </tr> </div> </form> </table> </div> </body> </html>
(PS: Bonne fete a tous)
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <html> <head> <title>Yahoo! Racing Manager</title> </head> <script language='Javascript'> window.resizeTo(490,250); </script> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "text"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions').appendChild(inp); } } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <div id="actions"> </div> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="160" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ <option value="4">Dépassements <option value="5">Prog complet <option value="6">Arrêt au stand <option value="7">Freins <option value="8">Seuil <option value="9">Motricité <option value="10">Aérodynamique <option value="11">Optim du moteur <option value="12">Optim du châssis <option value="13">Reco de la piste </select></td> <td width="40" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" /><input type="button" value="Repeter" onclick="doSomething()" /> </td> </tr> </table></td> </tr> </div> </form> </table> </div> </body> </html>
Bonjour.
L'action ne se repete toujours pas le nombre de fois voulu.
J'ai éssayer plusieurs méthode,mais je ne trouve toujours pas.
je sais que c'est cette value="akFahreTrainingsrunde" qui fait que mon action se fait une fois quand je clic sur mon boutton,es ce que j'y rajoute quelque chose pour que l'action se reproduise le nombre de fois voulu?Code:<input type="hidden" name="action" value="akFahreTrainingsrunde" />
Merci .Vins.
tu avais des petits problèmes de balises ;)
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 <html> <head> <title>Yahoo! Racing Manager</title> </head> <script type='text/javascript'> window.resizeTo(490,250); </script> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "text"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions').appendChild(inp); } } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="160" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ <option value="4">Dépassements <option value="5">Prog complet <option value="6">Arrêt au stand <option value="7">Freins <option value="8">Seuil <option value="9">Motricité <option value="10">Aérodynamique <option value="11">Optim du moteur <option value="12">Optim du châssis <option value="13">Reco de la piste </select></td> <td width="40" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" /><input type="button" value="Repeter" onclick="doSomething()" /> <div id="actions"> </div> </td> </tr> </table></td> </tr> </div> </form> </table> </body> </html>
Sa a pas l'air de vouloir fonctionner.
Peu etre faut il que je le change un boucle while?
Merci .Vins.
je vois pas ...qu'est -ce qui en fonctionne pas ??? parce que tu as bien x champs qui s'affichent ???il suffit de remplacer 'text' par 'hidden' pour ne pas les voirCitation:
Envoyé par vins25
je crois qui ya un truc de mal expliqué ou quoi ...:( :(
c'est cette partie là qui doit etre faite le nombre de fois voulu.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 <html> <script type='text/javascript'> function doSomething(){ nb = parseInt(document.getElementById('idinput').value,10); for(i=0;i<nb;i++){ inp = document.createElement("input"); inp.type = "text"; inp.name = "action"; inp.value = "akFahreTrainingsrunde"; document.getElementById('actions').appendChild(inp); } } </script> <body marginheight="5" marginwidth="5" leftmargin="5" topmargin="5"> <table width="350" cellpadding="0" cellspacing="0" border="1" align="left"> <form action="http://fr.racingmanager.yahoo.net/yracing/strecke-training.jsp" method="post" target="new"> <tr> <td width="350" height="18" bgcolor="#E5E5E5"> Entraînement spécifique</td> </tr> <tr> <td><table width="350" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="lang"> <tr> <td width="160" align="center"> <select name="trainingsschwerpunktTyp"> <option value="0" selected>virages serrés <option value="1">virages ouverts <option value="2">Vitesse élevée <option value="3">Départ </select></td> <td width="40" align="center"><input size="1" maxlength="2" type="text" id="idinput" /></td> <td width="150" align="center"><input type="submit" value="Valider essai" /><input type="button" value="Repeter" onclick="doSomething()" /> <div id="actions"> </div> </td> </tr> </table></td> </tr> </div> </form> </table> </body> </html>
Peu etre dois je y rajouter une notion de temps?Code:inp.value = "akFahreTrainingsrunde";
Merci .Vins.
écoute, un champ de formulaire, ça peut pas avoir plusieurs valeurs !!
excuse-moi si je comprends pas mais, c'est un peu bizarre ton truc :D