I have used the while loop to populate the textbox component using onchange jquery function. but i am unable to return the value 5 for each 5 component using jquery.
$(document).ready(function () {
$('#fname').change(function () {
var tot_row = 5;
var row = 0;
while (row < tot_row) {
var math_marks = eval('get_math_marks_' + row + '_value()');
var eng_marks = eval('get_eng_marks_' + row + '_value()');
var variance_marks = math_marks - eng_marks;
var component_to_be_replaced = 'variance_' + row;
$("#component_to_be_replaced").val("5");
row++;
}
});
});
I have been using the iframe.