...

View Full Version : input box dimension*price if dimension<350 callup 350.html in iframe



poseur04
07-07-2011, 02:40 AM
Solve thank you for that forum, kind pepole and very inspiring

<html>
<head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>dimension * price : then bring the right page in iframe depending of result</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">entrer your number here<br>
<input type="text" id="saisie_net" name="saisie_net"/>
<br>
<br><p>
<input type="button" value="result" onClick="donne_brut()">
</p>
<br>
your prices<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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum