
Originally Posted by
minusten
TCan you see why this wouldn't work im completely out of avenues to pursue

When clicking Add to List, the web browser reports this error:
Uncaught ReferenceError: val is not defined - test.html:58
So, this seems to be wrong:
Instead, you need to give the function the value from the input field, so instead of val you need to use this.form.elements.name.value instead, resulting in:
Code javascript:
insert(this.form.elements.name.value)
Then you get another error, which is good news. It means the first error is fixed. Progress!
The error is:
Uncaught ReferenceError: array is not defined - test.html:21
which is this line:
Code:
string += array[i] +"\n";
array is not used anywhere else in the code. Instead, I see that numbers is used.
That means that array[i] should instead be numbers[i]
Code javascript:
string += numbers[i] +"\n";
Then you have to work out why the sum section is not being updated.
Bookmarks