Display dynamically added Multi Array elements
<p>I have a javascript which creates two types of elements.
The PHP code is added on submiting the form, but I show it above.</p>

<p>The First type looks like this:</p>

<pre><code>&lt;tr class="disc"&gt;
    &lt;span&gt;&lt;?php echo $disc_number ?&gt;&lt;/span&gt;.
&lt;/tr&gt;
</code></pre>

<p>The Second type looks like this:</p>

<pre><code>&lt;tr class="track"&gt;
    &lt;input name="trackNumbers[]" value="&lt;?php echo $track_number ?&gt;" /&gt;
    &lt;input name="discNumbers[]" value="&lt;?php echo $disc_number ?&gt;" /&gt;
&lt;/tr&gt;
</code></pre>

<p>The "track" elements can be multiple for one "disc" element.</p>

<p>For example:</p>

<pre><code>&lt;tr class="disc"&gt;
    &lt;span&gt;1&lt;/span&gt;.
&lt;/tr&gt;
&lt;tr class="track"&gt;
    &lt;input name="trackNumbers[]" value="1" /&gt;
    &lt;input name="discNumbers[]" value="1" /&gt;
&lt;/tr&gt;
&lt;tr class="track"&gt;
    &lt;input name="trackNumbers[]" value="2" /&gt;
    &lt;input name="discNumbers[]" value="1" /&gt;
&lt;/tr&gt;
&lt;tr class="disc"&gt;
    &lt;span&gt;2&lt;/span&gt;.
&lt;/tr&gt;
&lt;tr class="track"&gt;
    &lt;input name="trackNumbers[]" value="1" /&gt;
    &lt;input name="discNumbers[]" value="2" /&gt;
&lt;/tr&gt;
&lt;tr class="track"&gt;
    &lt;input name="trackNumbers[]" value="2" /&gt;
    &lt;input name="discNumbers[]" value="2" /&gt;
&lt;/tr&gt;
</code></pre>

<p>To show on submit each "track" element I am using "for" command.</p>

<pre><code>for ($track_i = 0; $track_i &lt; $total_tracks; $track_i++)
</code></pre>

<p>But what about "disc" elements? How to make my "disc" elements to also display on submit, and to have their "track" elements after them.</p>
