I created a form that is added to the page with a button. I used JS to create the form to be added. The problem is that I have two fields one of value and another of hours, to count the value of the time worked. Then I applied to the input that receives the value data and time the function:
onblur="value();".
Value:
input name="horas" id="horas" type="text" value="" onblur="value();" class="form-control"
Time:
input name="valor" id="valor" type="text" value="" onblur="value();" class="form-control
This value function is as follows:
function value(){
var val= $("input[name*='valor]']").maskMoney('unmasked')[0];
var hs= Number($("input[name*='horas']").val());
var resul= (hours == 0 ? 0 : val/hs);
$('#resulVal').val(resulVal.toFixed(2).replace('.', ','));
}
When I add only ONE FORM, the function performs the account. But when adding more than one form the following do not make the account, it is as if the function was not activated for the others. What to do?