Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72443

Calculate with Javascript / HTML-Dropdowns

$
0
0

I have the price of an order in an PHP variable, let's say $price. This $price is the sum of a daily $rate * $rental_days. In the next step some extras could be added with three dropdowns in HTML. The first and the second are per order, the third per day.

<select id="extras_1">
 <option>10 Euros/Order</option>
 <option>20 Euros/Order</option>
</select>
<select id="extras_2">
 <option>20 Euros/Order</option>
 <option>30 Euros/Order</option>
</select>
<select id="extras_3">
 <option>10 Euros/Day</option>
 <option>20 Euros/Day</option>
</select>

I would like to add the price of the extras to the basic rate with Javascript, so that the user can see the final price directly. (The final price is calculated with PHP in the last step, so no worries about security.)

I am a total Jacascript newbie. Maybe someone wants to help me? Thank you!


Viewing all articles
Browse latest Browse all 72443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>