I am currently outputting a Total Gross Price, which is a sum of the Product Price and the Labour Cost. However, when a user has a certain discount, he should be able to fill this in and the total price should be recalculated, applying the discount on the product price only.
<body>
<p>The total gross price is: <b>€{{ total_price }}</b></p>
<form action="{{ url_for('sent') }}" id="formEmail" method="POST">
<div class="row">
<div class="column">
% Discount:
</div>
<div class="column">
<input type="number" name="discount" min="0" value="0">
</div>
</div>
<!---->
<div class="row">
<div class="column">
Email Address*:
</div>
<div class="column">
<input type="email" name="email" required />
</div>
</div>
<input type="submit" value="Send Price Estimate" />
</form>
</body>
The total price is input from the Flask function. However, when the user enters a discount above 0%, this should change to (product price(1-discount) + labour cost).
Can I use a jQuery function to real-time update this value?