how to control for loop
<p>this is my code......initially alltextboxes is showing...if i click the next or prev button it works properly....but i want only two textboxes per each click so initialy should show two text box ..........how i get it........how to solve......</p>

<p>see for full code:http://jsfiddle.net/sankarss/gAVZ8/22/</p>

<pre><code>function starts(values)
{

    maximum=values;
    var form = document.forms[0];
    var container = $("#sankar");
    container.empty();
    for (var i = 0; i &lt; maximum; i++)  
        container.append('&lt;fieldset style="width: 250px; height: 80px;"&gt;&lt;legend&gt;Files of ' +(i + 1) + ' / ' + maximum + '&lt;/legend&gt;&lt;input type="text" name="name' + i + '" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type="text" name="topic' + i + '" /&gt;&lt;/fieldset&gt;');

    goto(form, 0);
}
</code></pre>
