0
I have the following HTML
<form id="FrmLoja" method="post" action="#">
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="valor[]" id="valor" value="0" />
<input type="text" name="total" id="total" value="" />
</form>
I need to add all the values and insert the total result, without the need for a Reload on the page... This value field, is a dynamic field, where I have a btn (+) that adds a new line whenever needed, inside the array... How can I make this sum?
Hi @Juniornunes, I tried creating this example in jsfield https://jsfiddle.net/u590wvLz/ but it didn’t work
– Sr. André Baill
@Andrébaill It was problem with the declaration of function
sum
, ajeitei lá: https://jsfiddle.net/u590wvLz/1/– JuniorNunes