abracadabraPDF › Forums › PDF – Général › Problème calcul avec plusieurs cases à cocher › Répondre à : Problème calcul avec plusieurs cases à cocher
5 octobre 2018 à 16:29
#64623

Maître des clés
bonjour,
Voici ma proposition : Un script de calcul pour le champ TOTAL
Code:
if (this.getField(« Tarif »).value != « Off ») {
if (this.getField(« Tarif »).value==1 || this.getField(« Tarif »).value==3) {
var prix = 130;
} else {
var prix = 150;
}
} else {
var prix = 0;
this.getField(« reduc »).checkThisBox(0,false);
}
if (this.getField(« reduc »).value != « Off ») {
var reduction = prix*0.1;
} else {
var reduction = 0;
}
if (prix !=0) {
this.event.target.value = prix-reduction+ »,00 u20AC »;
} else {
this.event.target.value = « »;
}
if (this.getField(« Tarif »).value==1 || this.getField(« Tarif »).value==3) {
var prix = 130;
} else {
var prix = 150;
}
} else {
var prix = 0;
this.getField(« reduc »).checkThisBox(0,false);
}
if (this.getField(« reduc »).value != « Off ») {
var reduction = prix*0.1;
} else {
var reduction = 0;
}
if (prix !=0) {
this.event.target.value = prix-reduction+ »,00 u20AC »;
} else {
this.event.target.value = « »;
}
et un autre script d’action pour ne pouvoir cocher la case réduction que si une case est cochée ;
Code:
if (this.getField(« Tarif »).value != « Off ») {
this.getField(« reduc »).checkThisBox(0,true);
} else {
this.getField(« reduc »).checkThisBox(0,false);
}
this.getField(« reduc »).checkThisBox(0,true);
} else {
this.getField(« reduc »).checkThisBox(0,false);
}
@+
:bonjour: