I have a form with several text fields, and the number of text fields varies depending on the values that I retrieve from the database. What I'm trying to do is multiply all the values of the text field values, so first I put them in an array and multiply them and send the response to the text field. But I can not find the right answer.
For example, when I have 3 text fields and I enter 1 in each text field, I should get 1x1x1 = 1, but I get the answer as 3. When I enter 2 in each text field, I should get 2x2x2 = 8, but the answer 12.
My code is as follows:
Javascript Code:
function sumfrm(form){ var totalOdds = 0; var odds = document.getElementsByTagName('input'); var n; var i;
source share