Bonsoir Bovino,
C'est bien le nom du champ présent dans le code HTML.
Je viens finalement de trouver une solution. La voici :
Mes fonctions :
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
| <script language="javascript">
function doRound(x, places) {
return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function updateTTC(cht,cttc) {
var taxRate = 1.196;
var HTValue = document.getElementById(cht).value;
var TTCValue = HTValue*taxRate;
document.getElementById(cttc).value = doRound(TTCValue,4);
}
function updateHT(cht,cttc) {
var taxRate = 1.196;
var TTCValue = document.getElementById(cttc).value;
var HTValue = TTCValue/taxRate;
document.getElementById(cht).value = doRound(HTValue,4);
}
</script> |
Et l'écriture de mes champs textes en php :
echo TD_OPEN . '<table><tr><td class="smallText" align="right">HT :</td><td>' . tep_draw_input_field('event_record[' . $id . '][products_price]', $updates_price, 'size="' . FIELD_SIZE . '" id="ht' . $id . '"' . ' onBlur="reemplaza(this);validarSiNumero(this.value);" OnKeyUp="updateTTC(' . "'ht" . $id . "','ttc" . $id . "'" . ');"') . '</td></tr><tr><td class="smallText" align="right">TTC :</td><td>' . tep_draw_input_field('event_record_2[' . $id . '][products_price]', $updates_priceTTC, 'size="' . FIELD_SIZE . '" id="ttc' . $id . '"' . ' onBlur="reemplaza(this);validarSiNumero(this.value);" OnKeyUp="updateHT(' . "'ht" . $id . "','ttc" . $id . "'" . ');"') . '</td></tr></table>' . TD_CLOSE;
C'est pas très propre mais ca marche 
Bonne continuation et merci
Partager