I don’t know where to begin?
(textfield A / textfield B) = textfield C
And repeat/clone this table row automaticly .change on keyup of textfield B. Basically meaning that after the first calculation is made, another row will popup with unique ids etc.
<table>
<tr>
<td><input type="text" id="A" name="A"></td>
<td><input type="text" id="B" name="B"></td>
<td><input type="text" id="C" name="C" value=""></td>
</tr>
</table>
// Clone table rows
$(function() {
var i = 1;
$("#A").clone(function() {
$("table tr:first").clone(true).find("input").each(function() {
$(this).val('').attr('id', function(_, id) { return id + i });
$(this).val('').attr('name', function(_, name) { return name + i });
}).end().appendTo("table");
i++;
$("#C").val(Math.round(($("#A").val() / $("#B").val()) * 100 )+ "%");
});
});
I tried hard to understand your question. I have interpreted your question as:
DEMO: http://jsfiddle.net/vpsv9/
HTML:
JavaScript: