Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2783 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

   Solutionné dimension*prix if dimension<350 call 350.html dans iframe

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Solutionné dimension*prix if dimension<350 call 350.html dans iframe

n°2087799
poseur04
Posté le 07-07-2011 à 07:30:12  profilanswer
 

[résolu] voila la merveille
 
<html>
<head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>dimension * prix : appel la bonne page dans un iframe depand du resultat</TITLE>
 
<script type="text/javascript">
function donne_brut(){
var price = 2.41; //probably should hide this in form somehow?
var D = parseFloat(document.getElementById("saisie_net" ).value);
var Tot = (D * price).toFixed(2) ;  
 if ( isNaN(Tot) ) Tot = "";  
document.getElementById("champ_resultat" ).value = Tot;
  //alert(Tot);
   
  if (Tot > 3301){
   document.getElementById("myiFrame_Id" ).src = "http://localhost/1301+.html";
  }
  else  
  if (Tot > 2501&& Tot < 3300){
   document.getElementById("myiFrame_Id" ).src = "http://localhost/1300.html";
  }
  else  
  if (Tot > 1601&& Tot < 2500){
   document.getElementById("myiFrame_Id" ).src = "http://localhost/1000.html";
  }
  else  
  if (Tot > 851&& Tot < 1600){
   document.getElementById("myiFrame_Id" ).src = "http://localhost/650.html";
  }
  else  
  if (Tot < 850 && Tot > 2.40){
   document.getElementById("myiFrame_Id" ).src = "http://localhost/350.html";
  }
        else{
  //default page if no value entered
  document.getElementById("myiFrame_Id" ).src = "http://localhost/defaut.html";
  }
}  
</script>
 
</head>
<body>
   <div align="center">
       <form name="form_brut" action=""><div align="center">entrez vos chiffres ici<br>  
       <input type="text" id="saisie_net" name="saisie_net"/>
     <br>
    <br><p>  
      <input type="button" value="result" onClick="donne_brut()">
    </p>
    <br>
      votre prix : $ <br><input type="text" id="champ_resultat" name="champ_resultat" readonly />
  </div>
</form>  
 
<iframe id = "myiFrame_Id" width="650" height="800" frameborder="0" scrolling="no" ></iframe>
 
</body>
</html>


Message édité par poseur04 le 08-07-2011 à 18:26:13
mood
Publicité
Posté le 07-07-2011 à 07:30:12  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

   Solutionné dimension*prix if dimension<350 call 350.html dans iframe

 

Sujets relatifs
[html] video plein ecranfeuille de calcul dynamique dans une page html
Probleme Iframe et object.[Résolu] HTML::Parser, balises avec attribut
Macro Excel pour transformer les cellules enrichis en htmliframe div php include object Comment faire ?
Shadowbox hors d'une iframeAfficher résultats base mysql -> tableau html horizontal
Fabriquer un email en HTMLJPGRAPH ET HTML
Plus de sujets relatifs à : Solutionné dimension*prix if dimension<350 call 350.html dans iframe


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR