0

/*嘿。我有一个订购网站,您可以在其中订购旅馆房间。取决于入住的人数以及您在盒子中获得总价的时间。但是,如果您检查会员按钮,您将获得总订单的 20% 的折扣,我该如何获得。*/

订购网站

    var prices = new Object();
    function updateTotal () {
        var total = 0.00;

        for (var price in prices) {
            total += parseInt(prices[price]);
        }
        document.getElementById("medlem").value=updateTotal;
        document.getElementById("total").value = total;   
    }


    function doClear()
        {
            document.AddressForm.customer.value = "";
            document.AddressForm.adress.value = "";
            document.AddressForm.city.value= "";
            document.AddressForm.zip.value = "";
            document.AddressForm.phone.value= "";
            document.AddressForm.email.value= "";

            document.ComputerForm.cases[0].checked = false;         //nullstiller alle verdier fra start
            document.ComputerForm.cases[1].checked = false;
            document.ComputerForm.cases[2].checked = false;

            document.ComputerForm.monitors[0].checked = false;
            document.ComputerForm.monitors[1].checked = false;
            document.ComputerForm.monitors[2].checked = false;

            document.ComputerForm.faces[0].checked = false;
            document.ComputerForm.faces[1].checked = false;
            document.ComputerForm.faces[2].checked = false;

            document.ComputerForm.dager[1].checked = false;
            document.ComputerForm.dager[2].checked = false;
            document.ComputerForm.dager[3].checked = false;
            document.ComputerForm.dager[4].checked = false;
            document.ComputerForm.dager[5].checked = false;
            document.ComputerForm.dager[6].checked = false;


                  document.ComputerForm.pers[1].checked = false;
            document.ComputerForm.pers[2].checked = false;
            document.ComputerForm.pers[3].checked = false;
            document.ComputerForm.pers[4].checked = false;
            document.ComputerForm.pers[5].checked = false;
            document.ComputerForm.pers[6].checked = false;


            return;
        }

    //function totalPrice()
        //{
        //  var t1 = document.ComputerForm.cases.selected.value;
        //  var t2 = document.ComputerForm.monitors.selected.value;
        //  var t3 = document.ComputerForm.printers.selected.value;
        //  var total = document.AddressForm.total.value;

    //      total.value = t1.value + t2.value + t3.value;
    //  }

    </script>




    <h1 align="center">ordering site</h1>  <table border="black" cellpadding="10px" align="center">        <tr>            <td>
        <table cellpadding="10px">
    <form name="ComputerForm">
    <tr>
    <td>
     <strong>Member?</strong></br>
        <input type="radio" name="cases"  value="0" onchange="javascript:prices['cases'] = this.value; updateTotal();" /> member  </br>
        <input type="radio" name="cases" value="0" onchange="javascript:prices['cases'] = this.value; updateTotal();" /> not a member  </br>
    </td>
    <td>
    <tr>
    <td>
        <strong>Hotelroom</strong> <br/>
        <input type="radio" name="monitors" value="250.00" onchange="javascript:prices['monitors'] = this.value; updateTotal();" /> singelrooom </br>
        <input type="radio" name="monitors" value="500.00" onchange="javascript:prices['monitors'] = this.value; updateTotal();" /> double room </br>
        <input type="radio" name="monitors" value="1000.00" onchange="javascript:prices['monitors'] = this.value; updateTotal();" /> Suite </br>
    </td>
    <tr>
     <td>
     <strong> clean up</strong></br>
        <input type="radio" name="faces" value="500" onchange="javascript:prices['faces'] = this.value; updateTotal();" /> clean up    - + 500,-NOK   </br>
        <input type="radio" name="faces" value="0" onchange="javascript:prices['faces'] = this.value; updateTotal();" /> wash your self -  0,-NOK  </br>
     </td>            
    </tr>


    <b><strong>weeks</strong></b>
          <select name="dager" id="dagerid" onchange="javascript:prices['dager'] = this.value; updateTotal();" />
            <option value="1000" >1</option>
            <option value="2000">2</option>
            <option value="3000">3</option>
            <option value="4000">4</option>
            <option value="5000">5</option>
          </select>
    <br>
    <br>

    <b><strong>Ant. personer:</strong></b>
          <select name="pers" id="persid" onchange="javascript:prices['pers'] = this.value; updateTotal();" />
            <option value="1000">1</option>
            <option value="2000">2</option>
            <option value="3000">3</option>
            <option value="4000">4</option>
            <option value="5000">5</option>
          </select>

    <br>
    <br>

    <b><strong>Avreise fra;</strong></b>
          <select name="antpersoner" id="antpersoner" onchange="priceChange(this);">
            <option value="1">Gardermoen</option>
            <option value="2">Værnes</option>
            <option value="3">Stokmarknes international airport</option>
            <option value="4">Rygge</option>
            <option value="5">Torp</option>
          </select>

    <br>
    <br>


     <b>Avreisedato:</b>
          <select name="dag" id="dag">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
            <option value="16">16</option>
            <option value="17">17</option>
            <option value="18">18</option>
            <option value="19">19</option>
            <option value="20">20</option>
            <option value="21">21</option>
            <option value="22">22</option>
            <option value="23">23</option>
            <option value="24">24</option>
            <option value="25">25</option>
            <option value="26">26</option>
            <option value="27">27</option>
            <option value="28">28</option>
            <option value="29">29</option>
            <option value="30">30</option>
            <option value="31">31</option>
          </select>

          <select name="mnd" id="mnd">
            <option value="Oktober">Oktober</option>
            <option value="November">November</option>
            <option value="Desember">Desember</option>
            <option value="Januar">Januar</option>
            <option value="Februar">Februar</option>
            <option value="Mars">Mars</option>
          </select>

          <select name="år" id="år">
            <option value="2011">2013</option>
            <option value="2012">2014</option>
            <option value="2013">2015</option>
          </select> 


            </form>
            </table>            </td>           <td>
            <table padding="10px">
                <tr>
                <form name="AddressForm">

                Total price is:
            </td>
             <td>
                NOK<input type="text" name="total" readonly value="0.00" size="8" id="total">

             </td>
            </tr>
            <tr>
             <td>
                &nbsp;
             </td>
            </tr>
            <tr>
             <td>
                &nbsp;
             </td>
            </tr>
            <tr>
             <td>
                &nbsp;
             </td>
            </tr>

            <tr>
             <td>
              Navn:
             </td>
              <td>
                <input type="text" name="kunde" placeholder="Skriv inn fullt Navn" required />
              </td>
             </tr>
            <tr>
             <td>
                birthdate:
             </td>
             <td>
                <input type="number" name="birthdate" placeholder=" DD:MM:ÅR " required />
             </td>
            </tr>
             <tr>
                <td>
                adress:
            </td>
                <td>
                <input type="text" name="adress" placeholder="your adress " required />
             </td>
            </tr>
             <tr>
            <td>
                zip:
            </td>
            <td>
             <input type="text" name="poststed" placeholder="Skriv inn inn postedet ditt" required />
            </td>
            </tr>
                <tr>
                    <td>
                        city:
                    </td>
                    <td>
                        <select name="kommune" >
                            <option value=""></option>
                            <option value="ST">Sør trøndelag</option>
                            <option value="OS">Oslo</option>
                            <option value="NL">Nordland</option>
                            <option value="SF">Sandefjord</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td>
                        number:
                    </td>
                    <td>
                        <input type="text" name="phone" placeholder="write ur number" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Email :
                    </td>
                    <td>
                        <input type="text" name="email" placeholder="your email">
                    </td>
                </tr>
                </form>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="button" value="order" onClick="doSubmit()" />
                    </td>
                    <td>
                        <input type="button" value="clear" onClick="doClear()"  />
                    </td>
                </tr>
            </table>            </td>       </tr>   </table>  





            <!-- side -->
            <div class="side2">     

<div id="undertekst">
<p> Undertekst / nyttige lenker </p>
</div>

</body> 

4

0 回答 0