For some this may be a simple tasks but for others like my self i cant figure it out, im creating an online exam simlulator which has a total of 36 questions, im using the JS Formwizard to achieve the functionality im looking for which i found here
http://www.dynamicdrive.com/dynamicindex16/formwizard.htm its the first one in red, when the user gets to the last question number 36 the next button is hidden which is fine because there are no other questions to ask, but what i need to do is some how
when question 36 is shown, make my btnfinish button visible that way the user can press it and it will calculate the pass rate etc and carry on with the application my question is this how can i use Jquery to determin what question is shown and if its 36 show
the button? this is just a small snippet of how my HTML looks as i dont want to paste the lot as its quite long.
<fieldset class="sectionwrap" id="Q1">
<legend>Question 1</legend>
<p>
Which one of this five words means the same as <strong>TIRED</strong>? Write the number in the Answer
Square.</p>
<ol>
<li>LATE</li>
<li>CLIMB</li>
<li>HEAVY</li>
<li>WEARY</li>
<li>SLOW</li>
</ol>
<p style="margin-left:-5%">
<asp:TextBox ID="Q1Answer" runat="server" class="TextBox" />
</p>
</fieldset>
<fieldset class="sectionwrap" id="Q2">
<legend>Question 2</legend>
<p>
One of these numbers is wrong, because is does not follow the regular order of the
other numbers in the row.<br />
Write the number which is wrong in the Answer Square</p>
<p style="margin-left: 32%">
<strong>2 4 6 8 10 11 14 16</strong>
</p>
<div class="WhiteSpace">
</div>
<p style="margin-left: -5%">
<asp:TextBox ID="Q2Answer" runat="server" class="TextBox" />
</p>
</fieldset>
<fieldset class="sectionwrap" id="Q3">
<legend>Question 3</legend>
<p>
LID is related to BOX as CORK is related to......?<br />
Write the number of the correct word in the Answer Square.
</p>
<ol>
<li>WATER</li>
<li>LIFE BELT</li>
<li>BOTTLE</li>
<li>TREE</li>
<li>FLOAT</li>
</ol>
<p style="margin-left: -5%">
<asp:TextBox ID="Q3Answer" runat="server" class="TextBox" />
</p>
</fieldset>
As you can see every question has an ID of Q1, Q2, Q3 etc so when it gets to ID Q36 this is where i need the magic to happen....... can someone please help me with this.
Harrison.Sco...
Member
331 Points
456 Posts
How to show a button when a certain question is shown
Apr 07, 2012 10:43 AM|LINK
Hi Guys,
For some this may be a simple tasks but for others like my self i cant figure it out, im creating an online exam simlulator which has a total of 36 questions, im using the JS Formwizard to achieve the functionality im looking for which i found here http://www.dynamicdrive.com/dynamicindex16/formwizard.htm its the first one in red, when the user gets to the last question number 36 the next button is hidden which is fine because there are no other questions to ask, but what i need to do is some how when question 36 is shown, make my btnfinish button visible that way the user can press it and it will calculate the pass rate etc and carry on with the application my question is this how can i use Jquery to determin what question is shown and if its 36 show the button? this is just a small snippet of how my HTML looks as i dont want to paste the lot as its quite long.
<fieldset class="sectionwrap" id="Q1"> <legend>Question 1</legend> <p> Which one of this five words means the same as <strong>TIRED</strong>? Write the number in the Answer Square.</p> <ol> <li>LATE</li> <li>CLIMB</li> <li>HEAVY</li> <li>WEARY</li> <li>SLOW</li> </ol> <p style="margin-left:-5%"> <asp:TextBox ID="Q1Answer" runat="server" class="TextBox" /> </p> </fieldset> <fieldset class="sectionwrap" id="Q2"> <legend>Question 2</legend> <p> One of these numbers is wrong, because is does not follow the regular order of the other numbers in the row.<br /> Write the number which is wrong in the Answer Square</p> <p style="margin-left: 32%"> <strong>2 4 6 8 10 11 14 16</strong> </p> <div class="WhiteSpace"> </div> <p style="margin-left: -5%"> <asp:TextBox ID="Q2Answer" runat="server" class="TextBox" /> </p> </fieldset> <fieldset class="sectionwrap" id="Q3"> <legend>Question 3</legend> <p> LID is related to BOX as CORK is related to......?<br /> Write the number of the correct word in the Answer Square. </p> <ol> <li>WATER</li> <li>LIFE BELT</li> <li>BOTTLE</li> <li>TREE</li> <li>FLOAT</li> </ol> <p style="margin-left: -5%"> <asp:TextBox ID="Q3Answer" runat="server" class="TextBox" /> </p> </fieldset>As you can see every question has an ID of Q1, Q2, Q3 etc so when it gets to ID Q36 this is where i need the magic to happen....... can someone please help me with this.
Thank you for your time.