Oui, dans maFonctionje m'excuse j'avais l'intention de le faire, je me rattrape.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <html> <body> <?php $qte_saisie = $_POST['qte']; ?> <script type="text/javascript"> function maFonction() { var valeur = document.getElementById("qte").value; document.getElementById("monDiv").innerHTML = valeur; var cp = document.getElementById('qte'); var copie = document.getElementById('qtesaisie'); copie.value = cp.value; } </script> <form id="form1" name="form1" method="post" action="calculQte.php/?"> <table cellpadding="0" cellspacing="0" border="0"> <tr valign="middle"> <td><input type="text" name="qte" value="<?php echo $qte_saisie ?>" size="4" onBlur="maFonction()" /></td> <td><a href="#" onClick="{document.form1.qte.value++; maFonction(); }" ><img src="photos/plus.gif" width="14" height="10" border="0" hspace="0" vspace="0" /></a><br/><a href="#" onClick="{document.form1.qte.value--; maFonction();}"><img src="photos/moins.gif" width="14" height="10" border="0" hspace="0" vspace="0" /></a></td> </tr> <tr><td><div id="monDiv"></div> </td> <script type="text/javascript"> maFonction(); </script> <td></td> </tr> </table> </form> </body> </html>
Partager