Well, you are using eval(), not Number(). You don't seem to understand the forms[0].
That refers to the first form. When naming it, grades, you don't need it. You really are confused:


That would go into some sort of function:

which would be called from some sort of button:

To universalize your script, however, you might rather use something like this code:

To call the function:

I haven't got time to test this, but I think the last two codes posted of mine should help.