Logic for getting last entered row inside the HTML page before submit
<p>Hi Below is my requirement and I am trying to solve an issue.Please help</p>

<p>I have an HTML page intially with 5 empty rows as shown below
<img src="http://i.stack.imgur.com/HVXVs.png" alt="enter image description here"></p>

<p>If the user fills out all 5 rows another 5 rows will be refreshed
For this I am calling to java server side action by adding new rows to the arraylist. Each row is uniquely identified by large number and type of column
for eg:</p>

<pre><code>for name
&lt;input type="text" name="N-1111110001" value="" size="8" maxlength="12" &gt;&lt;/td&gt;
for comments
&lt;input type="text" name="C-1111110001" value="" size="30" maxlength="30"&gt;&lt;/td&gt;
for organization
&lt;select name="O-1111110001"&gt;
</code></pre>

<p>So if the user calls for submit after filling 'n' number of rows
I have to get the last filled row with values for iteration from 1111110001 to 111111000n</p>

<p>To know that I thought of using javascript for actullay sending the last entered values of row as part of URL to server
where I can do further saving.
The below is the function.</p>

<pre><code>function doFormActionAfterValidating(form,actionStr)
 {    

    var valuearray = new Array();
    var nameXS='N-';
     var namearray = new Array();
      valuearray.length = 0;
       for (i = 0; i &lt; document.forms.length; i++)
       {
           if (document.forms[i].name == 'dailyTaskListForm')
           {
              for (j = 0; j &lt; document.forms[i].elements.length; j++)
              {
                 if (document.forms[i].elements[j].name == 'tid')
                 {
                     valuearray[i]=nameXS.concat(document.forms[i].elements[j].value)
                     alert("valuearray[i]-"+valuearray[i]);


                 }
              }
           }
       }////This will give me array of values associated with names'
    ///Now my next step is find the last filled values out of these.

    for (i = 0; i &lt; document.forms.length; i++)
            {
               if (document.forms[i].name == 'dailyTaskListForm')
               {
                  for (j = 0; j &lt; document.forms[i].elements.length; j++)
                  {
                     if (document.forms[i].elements[j].name == valuearray[j])
                     {
                         namearray[i]=document.forms[i].elements[j].value
                         alert("namearray[i]-"+namearray[i]);


                     }
                  }
               }
            }      



 }
</code></pre>

<p>I am stuck at getting values from the array.Please help</p>
