I have three text boxes having ids: textbox1, textbox2, textbox3. I am retrieving values for first two textboxes from combo1.jsp by JSON and i want to add these two values and to display it on 3rd textboxes. Values of 1st textbox and 2nd textbox are coming from db, only i want to add these two values and to display in 3rd textbox.
$("#combo1").change(function() {
$.getJSON('combo1.jsp', { combo1Val : $(this).val() }, function(data) {
$("#textbox1").val(data.a);// suppose a's value came as 10 from db
$("#textbox2").val(data.b);// b's value came as 20 from db
$("#textbox3").val(data.c);// here i want to show the sum(a+b) that is 30
});
});
Any ideas please?