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.

`

$(’#id_quantity’).blur(function(){
var quantity = $(’#id_quantity’).val();
var price = $(’#id_price’).val();
var total = quantity * price;
(’#id_total’).val(total);
});

`

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

1 Like