here i code a javascript for total calculation but my problem is
on keyup function only one textbox is works i want to both textbox in keyup funtion to calculate
total (i.e) quantity and price at runtime i want to edit both to be edit to calculate total
$(function ()
{
$("[id*=grid_productdetails]input[type=text][id*=txt_price]").keyup(function (e)
{
var price = $(this).closest('tr').find("input[type=text][id*=txt_price]").val();
var quantity = $(e.target).closest('tr').find("input[type=text][id*=txt_quantity]").val();
var total = parseInt(price) * parseInt(quantity);
$(e.target).closest('tr').find("[id*=lblTotal]").text(total);
});
Loading
muthukumarPosted Sep 3, 2014, 5:30 AM
Anubhav ChaudharyPosted Sep 3, 2014, 4:57 AM
Firstly I would say that your question is not clear, either provide a complete question with the code you are using or use debugger in your code and check what's happening in the console of your browser by doing this you will be able to solve your problem by yourself.
Thanks
Guest UserPosted Sep 3, 2014, 4:27 AM
some other suggestions:
# you can put console.log ('test') at this and check whether keyup is triggering at both text boxes
# you can try to put onkeyup explicitly or rather use onchange and fire this calculation on both text boxes.
please try these suggestions