I'm attempting to extend an element for Joomla known as Jquarks. This component enables you to definitely create paginated quizzes, and answer the questions or correct your solutions by returning and forth with the questions. I believe this handled by some Javascript code.

This is actually the bit of code In my opinion makes this functionality work, but I'm not sure how to begin to modifying it. I wish to possess a dropdown list that contains all of the page amounts, to permit the consumer visit a navigate to some specific page.

// adding the back next link if multi-pages 
        if ($nbrPage > 1) 
        {
            if( $pNum == (int)($qNum / $nbrQuestionPage) || $qNum == $totalNbrQuestions ) 
            {

                if ($pNum == 1) 
                {
                    echo '<span class="jquarks_qprog"><a id="jquarksPage_' . $pNum . 'next" href="#">' . JText::_('NEXT') . '</a>'
                         . '<p>' . JText::_("PAGE") . ' ' . $pNum . ' / ' . $nbrPage .'</p>' .'</span></div>' ; 
                } 
                elseif ( $pNum == $nbrPage ) 
                {
                    echo '<span class="jquarks_qprog"><a id="jquarksPage_' . $pNum . 'back" href="#">' . JText::_('BACK') . '</a>'
                         . '<p>' . JText::_("PAGE") . ' ' . $pNum . ' / ' . $nbrPage .'</p>' .'</span></div>' ; 
                } 
                else 
                {
                    echo '<span class="jquarks_qprog"><a id="jquarksPage_' . $pNum . 'back" href="#">' . JText::_('BACK') . '</a>
                         |
                         <a id="jquarksPage_' . $pNum . 'next" href="#">' . JText::_('NEXT') . '</a>' 
                        . '<p>' . JText::_("PAGE") . ' ' . $pNum . ' / ' . $nbrPage .'</p>'   
                        . '</span></div>' ;
                }
                $pNum ++ ;
            } 
        } 
         $qNum++ ;
       } 
       if ($nbrPage == 1 ) :
            echo "</div>" ;
       endif ;
       ?>

</div>
<div style="clear: both;"></div>
<div>
    <p>
    <?php if ($nbrPage > 1) : ?>
        <input type="submit" value="<?php echo JText::_('SUBMIT_ANSWERS_CHECK_PAGES') ; ?>" id="send" name="send" />
    <?php else : ?>
    <input type="submit" value="<?php echo JText::_('SUBMIT_ANSWERS') ; ?>" id="send" name="send" />
    <?php endif ; ?>
    </p>    
    <p>
        <a href="http://www.jquarks.org" target="_blank">Powered by JQuarks</a>
    </p>
</div>

<?php 
    $attribs = array('type' => 'text/css');
    $document->addHeadLink(JRoute::_("components/com_jquarks/assets/stylesheets/SyntaxHighlighter.css"), "stylesheet", "rel", $attribs) ; 
?>

Here's a good example of javascript with an html drop lower:

<select onchange="window.location = this.value">
    <option value="#">Select a page</option>
    <option value="/foo.html">Foo Bar</option>
    <option value="/foo2.html">Foo Bar2</option>
    <option value="/foo3.html">Foo Bar3</option>
    <option value="/foo4.html">Foo Bar4</option>
</select>

I've not examined this in most browsers however it works in chrome. Usually I personally use jQuery therefore the could be:

<select onchange="window.location = $(this).val()">

I'll leave the transforming this to PHP as the homework assignment ) Cheers