How to display all numbers rather than just 1 number?
<pre><code>$('.num_questions').each( function() {

$(this).val(qnum);
++qnum;
$(".questionNum").text(qnum);
</code></pre>

<p>});</p>

<p>I have a hidden input (<code>.num_questions</code>). Now lets say I have 2 questions, it displays qnum 1 and 2 but when I post it into the next page, it displays qnum '3' for both questions as that would of been the next question number. </p>

<p>So what I want to know is how can I get <code>$(".num_questions").val(qnum);</code> to not display the next question number when I post the hidden input, but to display all of the question numbers it has displayed, so if I have 2 questions, for each num_question it displays the qnum and then adds 1 to the qnum for the next question which should hopefully make qnum 1 for question 1 and qnum 2 for question 2 when I post the hidden input into the next page and not qnum '3' for both questions.</p>

<p>Below is the form:</p>

<pre><code>    &lt;form id="QandA" action="insertQuestion.php" method="post" enctype="multipart/form-data"&gt;

&lt;div id="detailsBlock"&gt;
&lt;table id="question"&gt;
&lt;tr&gt;
    &lt;th colspan="2"&gt;
        Question Number &lt;span class="questionNum"&gt;1&lt;/span&gt;
        &lt;input type="hidden" class="num_questions" value="1" name="numQuestion"&gt;
    &lt;/th&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;/form&gt; 
</code></pre>

<p>Now where you see the span .questionNum, this works fine because for every question it adds a question number and then adds 1 for the next question, hence you get question number 1 for first question, question number 2 for second question etc. But the problem is that I can't post a span tag. So I need a hidden input field to be able to post onto the next page. But the hidden input value is only displaying 1 number for all the questions and that would be the very next question number which is '3' for the 2 questions example. I need it to store all of the question numbers so that when I post it, it will show question number 1, 2, 3, 4 etc. 1 question number per question. It works fine with the span but it is not doing it for the hidden input field</p>
