Hi guys,
i do have some problems with jquery and javascript,
may be you could help.
in html, actually in gsp (grails) i have a table with entries looks like this :
<td> <input type="text" style="background-color:transparent;border:0px solid white;" id="inputVar1="19"/> </td>
this field is appears more than one time, with the same id
is it possible to check every row as a new var ?
i mean, if i have like
10 id´s inputVar1,
10 id´s inputVar2,
10 id´s inputVar3
- and i´d like to multiplicate row-wise inputVar1*inputVar2+inputVar3
i managed it for one row, but the other rows wont work
looks like this
$(document).ready(function() {
var output = $("#outputVar"); //only one wich should add all of the rows outputs
$("#inputVar1").keyup(function() {
var $this = $(this);
var value = parseFloat($(this).val()); // this is inputVar1
var value2 = parseFloat($("#inputVar2").val());
var value3 = parseFloat($("#inputVar3").val());
output.val(((value - value * value2/100)*value3).toFixed(2));
});
});
i think its manageable through "$this." but i dont know how to us it with parseFloat, or at all ...
sorry for bad english
thanks for help