Automatic calculate total

I have three input form Django
price quantity total
I need when I input price and quantity automatic calculate total before I click submit
can I make that or not?
please, I need the answer by code

use jquery in the html. Do not forget to include jquery in the html/base template.


var quantity = $(’#id_quantity’).val();
var price = $(’#id_price’).val();
var total = quantity * price;


put jquery in script tags. here tags not coming in the reply.

1 Like