how to show text box in div
<p>This is my <code>index.php</code> page. Also the form is in my popup box for get the description.</p>

<pre><code>&lt;form action="" method="post" onsubmit="store(this); return false"&gt;
&lt;p&gt;
    &lt;input type="button" name="prev" onclick="goto(this.form, -1)" value="Previous" /&gt;
    &lt;input type="button" name="next" onclick="goto(this.form, +1)" value="Next" /&gt;
&lt;/p&gt;

&lt;div&gt;
    &lt;noscript&gt;Please enable JavaScript to see this form correctly&lt;/noscript&gt;
&lt;/div&gt;

&lt;p&gt;
    &lt;input type="submit" name="submit" value="Store in database" /&gt;
&lt;/p&gt;
</code></pre>

<p></p>

<p>this is my Javascript file <code>upload.js</code>.</p>

user selected files are there.-->

<p>var files=new Array();
          function insert(fileslist) 
             {
                files[files.length]=fileslist; </p>

<pre><code>            var filenames=(files.valueOf());
</code></pre>

<p>var max = files.length;
var current = 0;
function goto(form, pos) 
    {</p>

<pre><code>current += pos;
form.prev.disabled = current &lt;= 0;
form.next.disabled = current &gt;= max - 1;
var fields = form.getElementsByTagName('fieldset');
for (var i = 0; i &lt; fields.length; i++) fields[i].style.display = 'none';

fields[current].style.display = 'block';
form['name' + current].focus();
}
</code></pre>

<p>function store(form) 
    {</p>

<pre><code>var input = form.getElementsByTagName('input');
var data = ''; 
for (var i = 0; i &lt; input.length; i++) {
    if (input[i].getAttribute('type') == 'text')
        data += '&amp;' + input[i].getAttribute('name') + '=' + input[i].value;
}
data = encodeURI('n=' + max + data);
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xhr.open('POST', 'datainsert.php', true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('Content-length', data.length);
xhr.setRequestHeader('Connection', 'close');
xhr.onreadystatechange = function() {
    if (this.readyState == 4 &amp;&amp; this.status == 200) {
        if (this.responseText != '')
             alert(this.responseText); 
     else {

            form.submit.value = 'Saved!';
            setTimeout(function() { form.submit.value = 'Save to database' }, 500);
        }

    }
}
xhr.send(data);

}






window.onload = function() 
{
    var form = document.forms[0];
    var container = form.getElementsByTagName('div')[0];
    container.innerHTML = '';
    for (var i = 0; i &lt; max; i++)
        container.innerHTML += '&lt;fieldset style="width: 250px; height: 80px;"&gt;&lt;legend&gt;Files of ' +(i + 1) + ' / ' + max + '&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>

<p>The <code>&lt;div&gt;…&lt;/div&gt;</code> did not show the text boxes. Why?</p>
