JSFiddle - React, Tailwind, and code Playground
HTML
<form id="chronoform_Devis" method="post" name="Devis" >
<div class="titreRubrique2">1 - Informations sur l'Habitation Souhaitée</div>
<div style="width:575px;" class="ccms_form_element cfdiv_radio" id="choisissez_l_un_des_3_packs_container_div"><span style="color:#FFF; position:relative;top:5px;"><strong>Choisissez l'un des 3 packs</strong></span>
<br />
<div id="packEco"><input type="radio" name="choixpack" id="eco" title="choixpack" value="890" class="styled" />Pack Easy - 890€ le m<sup>²</sup></div>
<div id="packFamily"><input type="radio" name="choixpack" id="family" title="choixpack" value="1090" class="styled" />Pack Family - 1 090€ le m<sup>²</sup></div>
<div id="packOptimum"><input type="radio" name="choixpack" id="optimum" title="choixpack" value="1290" class="styled" />Pack Prenium - 1 290 € le m<sup>²</sup></div>
<div class="clear"></div><div id="error-message-choixpack"></div></div>
<br style='clear: both' />
<div class="colGauche"></div>
<div class="colMilieu" style="height:20px;"><p>Surface Souhaitée en M²</p></div>
<div class="colDroite" style="height:20px;"><p>Prix en € TTC </p></div>
<div style='clear: both;margin-bottom:30px'></div>
<div class="ccms_form_element cfdiv_text" id="surface_de_la_maison_souhait_e_en_m__container_div">
<div class="colGauche"><label for="qte_surfaceMaison">Surface Habitable Maison</label></div>
<div class="colMilieu"><input id="qte_surfaceMaison" maxlength="150" size="30" class="surfaceMaison" title="qte_surfaceMaison" type="text" value="" name="qte_surfaceMaison" onkeyup="javascript:calcul('surfaceMaison',this.value,'pack')" /><div class="clear"></div><div id="error-message-qte_surfaceMaison"></div></div></div>
<div class="colDroite"><div style="width:auto;" class="ccms_form_element cfdiv_text" id="_ttc_container_div"><input id="calcul_surfaceMaison" maxlength="150" size="30" class="calcul_surfaceMaison"...
CSS
label {color: #000;float: left;font-family: myriad;font-size: 8pt;line-height: 10px;margin: 6px 0 9px;padding-left: 25px;}
div, form {margin: 0;padding: 0;}
.preload {display: none;}
#header {margin-left: 25px;min-height: 800px;padding: 0;position: relative;top: 0;width: 750px;}
#title {background-color: #0A71B4;border: 2px solid #000;color: #000;font: bold 15px myriad;height: 27px;padding: 8px 0 0 10px;position: relative;text-align: left;top: 200px;width: 740px;}
#texteHaut {height: 35px;left: 0;padding-top: 5px;position: absolute;text-align: left;top: 240px;width: 550px;}
#texteHaut p {font: 14px verdana;margin: 0;padding: 0;}
.checkbox, .radio {background: url(http://dl.dropbox.com/u/32803028/labo/checkbox.png) no-repeat scroll 0 0 transparent;clear: left;display: block;float: left;height: 18px;padding: 0 5px 0 0;width: 18px;border: 1px solid #cacaca;}
.colonneGauche {width: 580px;position:relative;top:-315px;left:590px;}
.titreRubrique1 {background-color: #7BC041;border: 2px solid #000;float:left;color: #000;font: bold 13px myriad;height: 20px;padding: 2px 0 0 40px;position: relative;text-align: left;top: 0px;left:0px;width: 535px;}
.titreRubrique2 {background-color: #7BC041;border: 2px solid #000;color: #000;font: bold 13px myriad;height: 20px;padding: 2px 0 0 40px;position: relative;text-align: left;top:5px;width: 500px;}
#informations {border: 2px solid #696969;float: right;height: 110px;padding-right: 10px;position: relative;text-align: left;top: 250px;width: 735px;}
#right {float: right;position: relative;text-align: right;}
#options {height: 180px;padding-right: 10px;position: relative;top: 250px;width: 725px;}
.optionsDroite {width:575px;}
#choixFormule {margin: 0 auto;width: 725px;}
#nom, #prenom, #adresse, #cp, #ville, #telephone, #portable, #email, #surfaceMaison, #surfaceGarage, #terrasseCouverte, #terrasseNonCouverte, #total_de_votre_devis {float: left;font: 12px myriad;padding-left: 2px;padding-top: 2px;}
#surfaceMaison, #surfaceGarage,...
JavaScript
function defautValue(cas,val,defaut)
{
var valeur;
if(cas == 'focus' && val == defaut) valeur = '';
else if(cas == 'blur' && val == '') valeur = defaut;
else valeur = val;
return valeur;
}
function calcul(champ,qte,pu)
{
var total;
var field = document.getElementById('calcul_'+champ);
if(isNaN(parseFloat(qte)) ) qte = 0;
if( qte >= 0 || qte == '')
{
if(pu == 'pack') pu = parseFloat(getCheckedValue(document.forms["Devis"].elements["pack"]));
total = qte * pu;
field.value = total;
calculerTotal();
}
}
function calculerTotal()
{
var total_devis = 0;
var champs = ['surfaceMaison','surfaceGarage','terrasseCouverte','terrasseNonCouverte','cloture'];
var prix = ['pack','valeur','valeur','valeur'];
var options = ['toitureMultipentes','doucheItalienne','wcSuspendu','enduitTaloche','voletsRoulants','climGainable'];
for (var i in champs)
{
if(prix[i] == 'pack')
{
if(document.getElementById('optimum').checked == true) var pu = document.getElementById('optimum').value;
if(document.getElementById('family').checked == true) var pu = document.getElementById('family').value;
if(document.getElementById('eco').checked == true) var pu = document.getElementById('eco').value;
}
else
var pu = document.getElementById('pu_'+champs[i]).value;
var valeur = document.getElementById('qte_'+champs[i]).value;
if(valeur != '' && !isNaN(parseFloat(valeur)*parseFloat(pu)) )
{
var tot = parseFloat(valeur)*parseFloat(pu);
document.getElementById('calcul_'+champs[i]).value = tot;
total_devis += tot;
}
}
if(document.getElementById('optimum').checked != true)
{
var aPr = document.getElementsByTagName("span");
var iPr = aPr.length;
...