Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:34:23+00:00 2026-06-11T03:34:23+00:00

I can’t find the solution anywhere on the internet. I have a certain code

  • 0

I can’t find the solution anywhere on the internet.
I have a certain code with a variable “price” and a drop-down which is being included.

the drop-down has the values 1-40. When the value changes the total price should change immediately. as in the same row, as in final total price.

enter code here



 function calc(){
  one = document.getElementById("price1").childNodes.item(1).childNodes.item(1).value;
  two = parseFloat(document.getElementById("price1").childNodes.item(5).textContent.replace("€",""))
  document.getElementById("price1").childNodes.item(9).textContent =  one * two;
}
<tr id="price1">
        <td><?php include('optie.php');?></td>
        <td><strong>3-gangen traiteurmenu</strong><br>
            (incl. brood en boter)<br>******<br>
            Creme van gerookte paling<br>******<br>
            Gestoofde hertensukade met aardappelgratin, rodekool en een stoofpeertje.<br>******<br>
            Kerstbal van witte en pure chocolade en een vanillesaus.<br><hr>
            </td>
        <td><?php $prijs1= "16.50";?> &euro;<?php  echo $prijs1; ?></td>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&euro;</td>
        <td id="Total"></td> 
    </tr>

I added this code above, this correctly calculate the first dropdownmenu. But now, I must be able to do this times 13, with all the dropdownmenu’s

I now know it has to be done with java, because that is a dynamic language.

thanks in advance!

Jasper

beneath option.php

porties <select>
        <option value="0">0</option>
        <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>
        <option value="32">32</option>
        <option value="33">33</option>
        <option value="34">34</option>
        <option value="35">35</option>
        <option value="36">36</option>
        <option value="37">37</option>
        <option value="38">38</option>
        <option value="39">39</option>
        <option value="40">40</option>                                            
    </select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:34:24+00:00Added an answer on June 11, 2026 at 3:34 am
        function calc(){
      a = document.getElementById("price1").childNodes.item(1).childNodes.item(1).value;
      aa = parseFloat(document.getElementById("price1").childNodes.item(5).textContent.replace("€",""))
      z = document.getElementById("price1").childNodes.item(9).textContent =  Math.round(a * aa *100)/100;
    
      b = document.getElementById("price2").childNodes.item(1).childNodes.item(1).value;
      bb = parseFloat(document.getElementById("price2").childNodes.item(5).textContent.replace("€",""))
      zz = document.getElementById("price2").childNodes.item(9).textContent =  Math.round(b * bb *100)/100;
    
      c = document.getElementById("price3").childNodes.item(1).childNodes.item(1).value;
      cc = parseFloat(document.getElementById("price3").childNodes.item(5).textContent.replace("€",""))
      zzz = document.getElementById("price3").childNodes.item(9).textContent =  Math.round(c * cc *100)/100;
    
      d = document.getElementById("price4").childNodes.item(1).childNodes.item(1).value;
      dd = parseFloat(document.getElementById("price4").childNodes.item(5).textContent.replace("€",""))
      zzzz = document.getElementById("price4").childNodes.item(9).textContent =  Math.round(d * dd *100)/100;
    
      e = document.getElementById("price5").childNodes.item(1).childNodes.item(1).value;
      ee = parseFloat(document.getElementById("price5").childNodes.item(5).textContent.replace("€",""))
      zzzzzzzzzzz=document.getElementById("price5").childNodes.item(9).textContent =  Math.round(e * ee * 100)/100;
    
      f = document.getElementById("price6").childNodes.item(1).childNodes.item(1).value;
      ff = parseFloat(document.getElementById("price6").childNodes.item(5).textContent.replace("€",""))
      zzzzz = document.getElementById("price6").childNodes.item(9).textContent =  Math.round(f * ff *100)/100;
    
      g = document.getElementById("price6").childNodes.item(1).childNodes.item(1).value;
      gg = parseFloat(document.getElementById("price6").childNodes.item(5).textContent.replace("€",""))
      zzzzzzzzzzzz=document.getElementById("price6").childNodes.item(9).textContent =  Math.round(g * gg *100)/100;
    
    
      h = document.getElementById("price7").childNodes.item(1).childNodes.item(1).value;
      hh = parseFloat(document.getElementById("price7").childNodes.item(5).textContent.replace("€",""))
      zzzzzz = document.getElementById("price7").childNodes.item(9).textContent =  Math.round(h * hh *100)/100;
    
      i = document.getElementById("price8").childNodes.item(1).childNodes.item(1).value;
      ii = parseFloat(document.getElementById("price8").childNodes.item(5).textContent.replace("€",""))
      zzzzzzz = document.getElementById("price8").childNodes.item(9).textContent =  Math.round(i * ii *100)/100;
    
      j = document.getElementById("price9").childNodes.item(1).childNodes.item(1).value;
      jj = parseFloat(document.getElementById("price9").childNodes.item(5).textContent.replace("€",""))
      zzzzzzzz = document.getElementById("price9").childNodes.item(9).textContent =  Math.round(j * jj *100)/100;
    
      k = document.getElementById("price10").childNodes.item(1).childNodes.item(1).value;
      kk = parseFloat(document.getElementById("price10").childNodes.item(5).textContent.replace("€",""))
      zzzzzzzzz = document.getElementById("price10").childNodes.item(9).textContent =  Math.round(k * kk *100)/100;
    
      l = document.getElementById("price11").childNodes.item(1).childNodes.item(1).value;
      ll = parseFloat(document.getElementById("price11").childNodes.item(5).textContent.replace("€",""))
      zzzzzzzzzz = document.getElementById("price11").childNodes.item(9).textContent =  Math.round(l * ll *100)/100;
    
      document.getElementById("total").childNodes.item(9).textContent =  Math.round((z + zz + zzz + zzzz + zzzzz + zzzzzz + zzzzzzz + zzzzzzzz + zzzzzzzzz + zzzzzzzzzz + zzzzzzzzzzz + zzzzzzzzzzzz )*100)/100;
    
    }
    

    maybe not the prettiest code, but it works 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I order my users in the database, so I don't have to say
Can someone thoroughly explain the last line of the following code: def myMethod(self): #
I have a jquery bug and I've been looking for hours now, I can't
Can someone guide me on a possible solution? I don't want to use /bin/cp
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
Can't figure out how to do this in a pretty way : I have
Can someone help me with this scenario? *There is a button, which when tapped,
I have an autohotkey script which looks up a word in a bilingual dictionary
Can i get the source code for a WAMP stack installer somewhere? Any help
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.