Bonjour,

J'ai un script de devis en ligne :
Code html : 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
<p>*</p>
<p>*</p>
<p><span style="font-size: small; font-family: verdana, geneva; color: #ff0000;"><strong>Calculez le coût indicatif de votre correction</strong></span></p>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<p>*</p>
<form id="testform">
<p><span style="font-size: small; font-family: verdana, geneva;"><strong><label>Nombre de signes </label></strong></span><input id="nbchar" type="nombre" name="nbchar" value="0" /></p>
<p><span style="text-decoration: underline;"><em><span style="font-size: x-small; font-family: verdana, geneva;">Où trouver le nombre de signes ?</span></em></span></p>
<p><em><span style="font-size: x-small; font-family: verdana, geneva;">Word 2007/2010 : *Cliquez sur*sur l'onglet*<strong>Révisions</strong>, puis*<strong>Vérification</strong>*et enfin*<strong>Statistiques</strong>. Repérez la ligne<strong>*caractères espaces compris.</strong></span></em></p>
<p><em><span style="font-size: x-small; font-family: verdana, geneva;">Word 2003/OpenOffice :*<span>Cliquez sur*</span><strong>Outils</strong><span>, puis*</span><strong>Statistiques.*</strong><span>Repérez la ligne</span><strong>*caractères espaces compris.</strong></span></em></p>
<p><br /> <span style="font-size: small;"><label><strong>Formule</strong> </label></span><input type="radio" name="formule" value="1" checked="checked" /> Simple <input type="radio" name="formule" value="2" /> Approfondie</p>
<p><em><span style="font-size: x-small; font-family: verdana, geneva;">Voir <a href="formules/correction-reformulation">tableau comparatif</a></span></em></p>
<p><br /> <span style="font-size: small; font-family: verdana, geneva;"><strong><label>Statut </label></strong></span></p>
<select id="formjur" name="formjur">
<option value="0">Etudiant</option>
<option value="1">Particulier</option>
<option value="2">Professionnel</option>
</select><input type="submit" value="Calculer" /></form>
<div id="resultat">*</div>
<p>*</p>
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
$(function(){
 
        $("input:submit").click(
            function(){
                var calcul = 0;
                if($("input:checked").val() == 1){
                    if($("#formjur").val()== 1){
                        calcul = $("#nbchar").val() * 0.0029;
                    }else if ($("#formjur").val()== 2) {
                        calcul = $("#nbchar").val() * 0.0033;
                    }else{
                        calcul = $("#nbchar").val() * 0.0025;
                    }
                }else{
                    if($("#formjur").val()== 1){
                        calcul = $("#nbchar").val() * 0.004375;
                    }else if ($("#formjur").val()== 2) {
                        calcul = $("#nbchar").val() * 0.005;
                    }else{
                        calcul = $("#nbchar").val() * 0.00375;
                    }
                }
                var resultat = Math.ceil(calcul);
                $("#resultat").html("Le montant indicatif de votre devis est de <b>"+resultat+"<b> &euro;");
                return false;
            }
 
        );
 
    });
Je cherche, sans succès, à appliquer un tarif dégressif (-10 % à partir de 100 000 signes ; - 15 % à partir de 200 000 signes).

Merci énormément de votre aide.

Liliana