editing document.form.value field name

Hi, in my jsp page, i allow the user to add items to a list and the list is displayed on the same page. The field name of the new item is incremented by 1. for example for item 1 - field name is 'level0' for item 2 - field name is 'level1' for item 3 - field name is 'level2' etc.

I using this way to save the values later in an array.

But my question is that: I need to check the value of the field in javascript. I am sending the length of the array to my javascript function but how to i get the value of the field.