Bonjour,


Voilà un pbl qui arrive à pas mal de monde mais ne connaissant rien au javascript je m'adresse à vous.

J'ai un bout de code qui fonctionne très bien avec internet explorer 7 mais qui ne fonctionne plus sous mozilla firefox une fois qu'il est en ligne (en local ca marche).

Voilà le code, pour info je l'ai fait avec 1rst Javascript editor au cas ou cela peut avoir une incidence :

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script language="javascript" type="text/javascript">
 
var montant=2000;
 
 
function change(tt)
{
switch (tt)
{
    case 48:
 
     prix.value=(Math.round(montant/tt*100))/100 + '€ x ' + tt + 'mois';
     prixjour.value= (Math.round(montant/tt/30*100))/100 + '€';
 
        break;
    case 36:
     prix.value=(Math.round(montant/tt*100))/100 + '€ x ' + tt + 'mois';
     prixjour.value= (Math.round(montant/tt/30*100))/100 + '€';
        break;
    case 24:
     prix.value=(Math.round(montant/tt*100))/100 + '€ x ' + tt + 'mois';
     prixjour.value= (Math.round(montant/tt/30*100))/100 + '€';
        break;
    case 12:
     prix.value=(Math.round(montant/tt*100))/100 + '€ x ' + tt + 'mois';
     prixjour.value= (Math.round(montant/tt/30*100))/100 + '€';
        break;
    default:
    prix.value="erreur";
}   
}
 
 
</script>
 
 
<table border="0" bgcolor="blue">
<tr bgcolor="yellow"><td colspan="2"><p align=center><u><font face="verdana" color="blue"><b>choississez une durée</b></font></u></p></td>
</tr>
   <tr>
      <td><input name="48mois" id="48mois" type="button" value="48 mois" onclick="change(48);" style="font-family: Verdana,Arial, Helvetica;font-size: 11px; color:#330033 ;font-weight:bold;background-color: #FFCC00;"></td>
 
 
 
      <TD ROWSPAN=2><input name="prixjour" id="prixjour" type="label" value= "1,39€" size="60" maxlength="45" readonly="true"                 style="align=center; font-family: Arial,Verdana,Helvetica;font-size: 25px; color:red ;font-weight:bold; background-color: #FFCC00;width:88px; height:60px:">&nbsp;<font face="verdana" size="-1" color="yellow"><b>par jour</b></font></TD>
 
 
 
   </tr>
   <tr>
      <td><input name="36mois" id="36mois" type="button" value="36 mois" onclick="change(36);" style="font-family: Verdana,Arial, Helvetica;font-size: 11px; color:#330033 ;font-weight:bold;background-color: #FFCC00;"></td>
   </tr>
   <tr>
      <td><input name="24mois" id="24mois" type="button" value="24 mois" onclick="change(24);" style="font-family: Verdana,Arial, Helvetica;font-size: 11px; color:#330033 ;font-weight:bold;background-color: #FFCC00;"></td>
 
 
 
 
      <TD ROWSPAN=2><input name="prix" id="prix" type="text" value="41,67€ x 48 mois"  size="60" maxlength="60" readonly="true" style="align=center; font-family: Arial,Verdana,Helvetica;font-size: 15px; color:blue ;font-weight:bold;background-color: white;width:130px;"></TD>
 
 
 
   </tr>
   <tr>
      <td><input name="12mois" id="12mois" type="button" value="12 mois" onclick="change(12);" style="font-family: Verdana,Arial, Helvetica;font-size: 11px; color:#330033 ;font-weight:bold;background-color: #FFCC00;"></td>
   </tr>
</table>