Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Location
    Montréal, Canada
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    input box dimension*price if dimension<350 callup 350.html in iframe

    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>
    Last edited by poseur04; 07-08-2011 at 05:54 PM. Reason: solve


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •