Build form field names dynamically in JavaScript and assign values
<p>The code:</p>

<pre><code>function updateValues(res){
                var rows=res.ROWCOUNT;
                for (i=0;i&lt;rows;i++){
                    var x='document.Eventform.txt_'+res.DATA.EVENT_LENDER_ID[i];
                    x.value=res.DATA.EVENT_DAYS[i];
                }
            }
</code></pre>

<p><code>res</code> is a JSON object passed to the function and we need to dynamically build form fields names and assign values to these fields (the form field name that are dynamically build will exist in the form).</p>
